In the Method and associated function.rs file, There are examples of defining and using methods and associated functions for structs.
All the codes in the list below has been taught in the Rust free tutorial in persian No: 11.
- Struct creation
- Struct instantiation
- Method creation
- Method with Ownership moving
- Printing an instance of a struct
- Associated Function
- Struct creation shorthand
Other concepts those are directly related to the structs and has been taught in the Rust free tutorial in perisan No: 12.
- Tuple Like Structs (
TupleLikeStruct.rs) - Unit Like Structs (
UnitLikeStructs.rs) - Value Inheritance (
ValueInheritance.rsandValueInheritanceWithClone.rs) - Infinite Recursive Type Problem (
RecursiveTypeInfiniteSize.rs)