Rust
Ownership
In Rust, unlike C++, by default, on a function call, the ownership of parameters is transferred; the copy should be explicit (.clone()).
Borrowing
Cannot mutate while shared.
Mutable borrow
Cannot access while borrowed.
Can access the mutable borrowed variable.
Lifetime reference
Traits
Marker traits
- trait Send { }: Safe to send between thread: String, u32, Arc<String>
- trait Copy { }: Safe to memcpy: u32, f32,