15 lines
497 B
Markdown
15 lines
497 B
Markdown
# Constructors in rust
|
|
|
|
Rust is a special case for constructors. The language itself is already
|
|
different from most other languages in structure, especially for object oriented
|
|
programming.
|
|
|
|
Simply said, there are no constructors in rust. When you create an object, you
|
|
have to initialize all data immediately and by yourself.
|
|
|
|
You can look into the classes or instances examples to see how object
|
|
construction is done in rust.
|
|
|
|
- [main.rs](./classes/src/main.rs)
|
|
- [car.rs](./classes/src/car.rs)
|