oop-examples/rust/Constructors.md
2020-05-10 16:07:27 +02:00

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)