Generic Data Types - The Rust Programming Language
We use generics to create definitions for items like function signatures or structs, which we can then use with many different concrete data types. Let’s first look at how to define functions, structs, enums, and methods using generics. Then we’ll discuss how generics affect code performance.
Generic Data Types - The Rust Programming Language Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Rust Programming Language Generic Data Types We use generics to create definitions for items like function signatures or structs, which we can then use with many different concrete data types. Let’s first look at how to define functions, structs, enums, and methods using generics. Then, we’ll discuss how generics affect code performance. In Function Definitions W
Explore this link on the map →saved by
related reading
- Generic Types, Traits, and Lifetimes - The Rust Programming Languagedoc.rust-lang.org
- Defining and Instantiating Structs - The Rust Programming Languagedoc.rust-lang.org
- An Example Program Using Structs - The Rust Programming Languagedoc.rust-lang.org
- Defining an Enum - The Rust Programming Languagedoc.rust-lang.org
- Defining Shared Behavior with Traits - The Rust Programming Languagedoc.rust-lang.org
- Validating References with Lifetimes - The Rust Programming Languagedoc.rust-lang.org
- Methods - The Rust Programming Languagedoc.rust-lang.org
- References and Borrowing - The Rust Programming Languagedoc.rust-lang.org
- A half-hour to learn Rustfasterthanli.me
- Programming a Guessing Game - The Rust Programming Languagedoc.rust-lang.org
- The Slice Type - The Rust Programming Languagedoc.rust-lang.org
- Rust Language Cheat Sheetcheats.rs