Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
C Analogy of method.c
Method and associated function.rs
README.md
RecursiveTypeInfiniteSize.rs
TupleLikeStruct.rs
UnitLikeStruct.rs
ValueInheritance.rs
ValueInheritanceWithClone.rs

README.md

Method Definition and Usage Example

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.

Basic Concpets

  • 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.

Advanced Concepts

  • Tuple Like Structs (TupleLikeStruct.rs)
  • Unit Like Structs (UnitLikeStructs.rs)
  • Value Inheritance (ValueInheritance.rs and ValueInheritanceWithClone.rs)
  • Infinite Recursive Type Problem (RecursiveTypeInfiniteSize.rs)
You can’t perform that action at this time.