Organizing Data with Structs
Structs allow you to name and group related values.
rust struct User { username: String, email: String, active: bool, }
Implementation Blocks
You define methods for structs inside impl blocks.
rust impl User { fn deactivate(&mut self) { self.active = false; } }
In Web3, structs are used to define the state of a contract (e.g., a Wallet or a Token).