Skip to content

SPACEDAO/awesome-rust-recipes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

awesome-rust-recipes

Awesome Archive of Programming Recipes on Rust Language

Types and Libraries

  • Rust has a number of types named Result in its standard library
  • The Result types are enumerations, often referred to as enums.
  • An enumeration is a type that can have a fixed set of values,called the enum’s variants.

Types and Error Handling

  • The purpose of these Result types is to encode error-handling information.
  • An instance of io::Result has an expect method that you can call.

Values and Variables

  • We can think of {} as little crab pincers that hold a value in place.
  • You can print more than one value using curly brackets

Randomness and Crates

  • Rust doesn’t yet include random number functionality in its standard library.
  • Rust team provides a rand crate at https://crates.io/crates/rand