Type Associated functions

= Associated functions, without self as parameter

Example

//constructors:

impl Person {
	// new isn't a keyword, but best practice
	pub fn new() -> Person {
		name: "John"
	}
}

let p = Person::new()

🔗 Links

🏰 Rust Structs