Cargando…

Mastering Rust : Learn about Memory Safety, Type System, Concurrency, and the New Features of Rust 2018 Edition, 2nd Edition.

Mastering Rust, Second Edition covers a comprehensive list of topics that will help you gain deeper insights into the language. It will allow you how to create high performing applications effortlessly.

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Sharma, Rahul
Otros Autores: Kaihlavirta, Vesa
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing Ltd, 2019.
Edición:2nd ed.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Title Page; Copyright and Credits; About Packt; Contributors; Table of Contents; Preface; Chapter 1: Getting Started with Rust; What is Rust and why should you care?; Installing the Rust compiler and toolchain; Using rustup.rs; A tour of the language; Primitive types; Declaring variables and immutability; Functions; Closures; Strings; Conditionals and decision making; Match expressions; Loops; User-defined types; Structs; Enums; Functions and methods on types; Impl blocks on structs; Impl blocks for enums; Modules, imports, and use statements; Collections; Arrays; Tuples; Vectors
  • HashmapsSlices; Iterators; Exercise
  • fixing the word counter; Summary; Chapter 2: Managing Projects with Cargo; Package managers; Modules; Nested modules; File as a module; Directory as module; Cargo and crates; Creating a new Cargo project; Cargo and dependencies; Running tests with Cargo; Running examples with Cargo; Cargo workspace; Extending Cargo and tools; Subcommands and Cargo installation; cargo-watch; cargo-edit; cargo-deb; cargo-outdated; Linting code with clippy; Exploring the manifest file
  • Cargo.toml; Setting up a Rust development environment
  • Building a project with Cargo
  • imgtoolSummary; Chapter 3: Tests, Documentation, and Benchmarks; Motivation for testing; Organizing tests; Testing primitives; Attributes; Assertion macros; Unit tests; First unit test; Running tests; Isolating test code; Failing tests; Ignoring tests; Integration tests; First integration test; Sharing common code; Documentation; Writing documentation; Generating and viewing documentation; Hosting documentation; Doc attributes; Documentation tests; Benchmarks; Built-in micro-benchmark harness; Benchmarking on stable Rust
  • Writing and testing a crate
  • logic gate simulatorContinuous integration with Travis CI; Summary; Chapter 4: Types, Generics, and Traits; Type systems and why they matter; Generics; Creating generic types; Generic functions; Generic types; Generic implementations; Using generics; Abstracting behavior with traits; Traits; The many forms of traits; Marker traits; Simple traits; Generic traits; Associated type traits; Inherited traits; Using traits with generics
  • trait bounds; Trait bounds on types; Trait bounds on generic functions and impl blocks; Using + to compose traits as bounds
  • Trait bounds with impl trait syntaxExploring standard library traits; True polymorphism using trait objects; Dispatch; Trait objects; Summary; Chapter 5: Memory Management and Safety; Programs and memory; How do programs use memory?; Memory management and its kinds; Approaches to memory allocation; The stack; The heap; Memory management pitfalls; Memory safety; Trifecta of memory safety; Ownership; A brief on scopes; Move and copy semantics; Duplicating types via traits; Copy; Clone; Ownership in action; Borrowing; Borrowing rules; Borrowing in action; Method types based on borrowing