Rust and Cargo 1 · Code patterns
Define a struct
Define a type and derive common traits for debugging, copying and comparing.
#[derive(Debug, Clone, PartialEq)]
struct User {
name: String,
age: u32,
}
Official Rust and Cargo 1 documentation
Rust and Cargo 1 · Code patterns
Define a type and derive common traits for debugging, copying and comparing.
#[derive(Debug, Clone, PartialEq)]
struct User {
name: String,
age: u32,
}
Official Rust and Cargo 1 documentation
Was this page helpful?