Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
C Analogy of method.c
Method and associated

Method Definition and Usage Example

In the Method and associated 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 (
  • Unit Like Structs (
  • Value Inheritance ( and
  • Infinite Recursive Type Problem (
You can’t perform that action at this time.