Rust Quick Start Guide : the Easiest Way to Learn Rust Programming.
Rust is an emerging programming language applicable to areas such as embedded programming, network programming, system programming, and web development. This book will take you from the basics of Rust to the point where your code compiles and does what you intend!
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing Ltd,
2018.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Title Page; Copyright and Credits; Packt Upsell; Contributors; Table of Contents; Preface; Chapter 1: Getting Ready; Installing Rust; Starting a new project; Project metadata; Dependencies on libraries from crates.io; Dependencies on Git repositories; Dependencies on local libraries; Automatically generated source files; Compiling our project; Debug and release builds; Dynamic libraries, software distribution, and Rust; Using crates.io; Summary; Chapter 2: Basics of the Rust Language; Functions; Defining a function; Modules; Defining a module; A module as a section of a file
- A module as a separate fileAccessing module contents from outside; Using the item's full name directly; Using the item's short name; Public and private module items; Expressions; Literal expressions; Operator expressions; Array and tuple expressions; Block expressions; Branch expressions; Loop expressions; while loops; for loops; Variables, types, and mutability; Type inference; Data structures; Mutability of data structures; More about functions; Parameters; Return types; Error handling; Using Result to signal success or failure; Calling functions that return Result
- Implementing behavior for typesSummary; Chapter 3: The Big Ideas
- Ownership and Borrowing; Scope and ownership; The stack; Transferring ownership; Copying; Lending; Lending immutably; Lending mutably; Accessing borrowed data; The lifetime of borrowed data; Ownership and the self parameter; Moving self; Borrowing self; Mutably borrowing self; Summary; Chapter 4: Making Decisions by Pattern Matching; Variable assignment with pattern matching; Using if let expressions to test whether a pattern matches; Using match to choose one of several patterns; Using don't care in patterns
- Moving and borrowing in pattern matchesMatching tuples and other more complex patterns; Nested patterns; Storing a matched value and comparing it to a pattern; Ignoring most of a data structure; Gotchas; Not all values can be matched against a literal pattern; Patterns assign values to variable names; Summary; Chapter 5: One Data Type Representing Multiple Kinds of Data; Enumerations; Basic enumerations; Parameterized enumerations; Checking the value type and extracting parameter values; Result is an enumeration, accessed via the prelude; Traits and trait objects; Traits
- Implementing our PrintableDirection traitTrait objects; Using our PrintableDirection trait; Trait objects only provide access to the trait interface; Any; Any can store almost anything; But to access it we have to already know about the real data type; Comparison of these techniques; Summary; Chapter 6: Heap Memory and Smart Pointers; Box; Box and variable size; Box and Any; Vec and String; String; Vec; Rc; Weak references; Cell and RefCell; Cell; What's the point?; RefCell; Arc; Mutex and RwLock; Summary; Chapter 7: Generic Types; Types with generic type parameters