Found 7 bookmarks
Newest
Inserting values of multiple types in Rust's HashMap
Inserting values of multiple types in Rust's HashMap
How to build a heterogeneous collection in Rust, using values of different types.
let mut map: HashMap<&str, Box<dyn Display + 'static>> = HashMap::new();
·simonewebdesign.it·
Inserting values of multiple types in Rust's HashMap
Enums and Pattern Matching in Rust
Enums and Pattern Matching in Rust
In Rust, enums are composite data types that can have multiple variants. In this article, we show you how to define, instantiate, and use them. We also cover pattern matching and two common enums for error handling: Option and Result.
·serokell.io·
Enums and Pattern Matching in Rust
Traits in Rust
Traits in Rust
In this article, we cover the basics of traits in Rust: what they are, when they are useful, and how to use them.
·serokell.io·
Traits in Rust
Generics in Rust
Generics in Rust
With Rust generics, programmers can write general algorithms that work with arbitrary types, reducing code duplication and providing type safety. In this article, we show when and how to use them.
·serokell.io·
Generics in Rust
Get Started with Rust: Structs
Get Started with Rust: Structs
In Rust, structs are composite data types that contain multiple related types. In this article, we show you how to define and instantiate structs, derive traits for them, and create struct methods.
·serokell.io·
Get Started with Rust: Structs