ORPP logo
Image from Google Jackets

The the Complete Rust Programming Reference Guide : Design, Develop, and Deploy Effective Software Systems Using the Advanced Constructs of Rust.

By: Contributor(s): Material type: TextTextPublisher: Birmingham : Packt Publishing, Limited, 2019Copyright date: ©2019Edition: 1st edDescription: 1 online resource (685 pages)Content type:
  • text
Media type:
  • computer
Carrier type:
  • online resource
ISBN:
  • 9781838826383
Subject(s): Genre/Form: Additional physical formats: Print version:: The the Complete Rust Programming Reference GuideDDC classification:
  • 005.3
LOC classification:
  • QA76.76.A65 .S537 2019
Online resources:
Contents:
Cover -- Title Page -- Copyright -- 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 -- Hashmaps -- Slices -- 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 - imgtool -- Summary -- 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 simulator -- Continuous 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 syntax -- Exploring 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 -- Lifetimes -- Lifetime parameters -- Lifetime elision and the rules -- Lifetimes in user defined types -- Lifetime in impl blocks -- Multiple lifetimes -- Lifetime subtyping -- Specifying lifetime bounds on generic types -- Pointer types in Rust -- References - safe pointers -- Raw pointers -- Smart pointers -- Drop -- Deref and DerefMut -- Types of smart pointers -- Box&lt -- T&gt -- -- Reference counted smart pointers -- Rc&lt -- T&gt -- -- Interior mutability -- Cell&lt -- T&gt -- -- RefCell&lt -- T&gt -- -- Uses of interior mutability -- Summary -- Chapter 6: Error Handling.
Error handling prelude -- Recoverable errors -- Option -- Result -- Combinators on Option/Result -- Common combinators -- Using combinators -- Converting between Option and Result -- Early returns and the ? operator -- Non-recoverable errors -- User-friendly panics -- Custom errors and the Error trait -- Summary -- Chapter 7: Advanced Concepts -- Type system tidbits -- Blocks and expressions -- Let statements -- Loop as an expression -- Type clarity and sign distinction in numeric types -- Type inference -- Type aliases -- Strings -- Owned strings - String -- Borrowed strings - &amp -- str -- Slicing and dicing strings -- Using strings in functions -- Joining strings -- When to use &amp -- str versus String ? -- Global values -- Constants -- Statics -- Compile time functions - const fn -- Dynamic statics using the lazy_static! macro -- Iterators -- Implementing a custom iterator -- Advanced types -- Unsized types -- Function types -- Never type ! and diverging functions -- Unions -- Cow -- Advanced traits -- Sized and ?Sized -- Borrow and AsRef -- ToOwned -- From and Into -- Trait objects and object safety -- Universal function call syntax -- Trait rules -- Closures in depth -- Fn closures -- FnMut closures -- FnOnce closures -- Consts in structs, enums, and traits -- Modules, paths, and imports -- Imports -- Re-exports -- Selective privacy -- Advanced match patterns and guards -- Match guards -- Advanced let destructure -- Casting and coercion -- Types and memory -- Memory alignment -- Exploring the std::mem module -- Serialization and deserialization using serde -- Summary -- Chapter 8: Concurrency -- Program execution models -- Concurrency -- Approaches to concurrency -- Kernel-based -- User-level -- Pitfalls -- Concurrency in Rust -- Thread basics -- Customizing threads -- Accessing data from threads -- Concurrency models with threads.
Shared state model -- Shared ownership with Arc -- Mutating shared data from threads -- Mutex -- Shared mutability with Arc and Mutex -- RwLock -- Communicating through message passing -- Asynchronous channels -- Synchronous channels -- thread-safety in Rust -- What is thread-safety? -- Traits for thread-safety -- Send -- Sync -- Concurrency using the actor model -- Other crates -- Summary -- Chapter 9: Metaprogramming with Macros -- What is metaprogramming? -- When to use and not use Rust macros -- Macros in Rust and their types -- Types of macros -- Creating your first macro with macro_rules! -- Built-in macros in the standard library -- macro_rules! token types -- Repetitions in macros -- A more involved macro - writing a DSL for HashMap initialization -- Macro use case - writing tests -- Exercises -- Procedural macros -- Derive macros -- Debugging macros -- Useful procedural macro crates -- Summary -- Chapter 10: Unsafe Rust and Foreign Function Interfaces -- What is safe and unsafe really? -- Unsafe functions and blocks -- Unsafe traits and implementations -- Calling C code from Rust -- Calling Rust code from C -- Using external C/C++ libraries from Rust -- Creating native Python extensions with PyO3 -- Creating native extensions in Rust for Node.js -- Summary -- Chapter 11: Logging -- What is logging and why do we need it? -- The need for logging frameworks -- Logging frameworks and their key features -- Approaches to logging -- Unstructured logging -- Structured logging -- Logging in Rust -- log - Rust's logging facade -- The env_logger -- log4rs -- Structured logging using slog -- Summary -- Chapter 12: Network Programming in Rust -- Network programming prelude -- Synchronous network I/O -- Building a synchronous redis server -- Asynchronous network I/O -- Async abstractions in Rust -- Mio -- Futures -- Tokio.
Building an asynchronous redis server -- Summary -- Chapter 13: Building Web Applications with Rust -- Web applications in Rust -- Typed HTTP with Hyper -- Hyper server APIs - building a URL shortener -- hyper as a client - building a URL shortener client -- Web frameworks -- Actix-web basics -- Building a bookmarks API using Actix-web -- Summary -- Chapter 14: Lists, Lists, and More Lists -- Linked lists -- A transaction log -- Adding entries -- Log replay -- After use -- Wrap up -- Upsides -- Downsides -- Doubly linked list -- A better transaction log -- Examining the log -- Reverse -- Wrap up -- Upsides -- Downsides -- Skip lists -- The best transaction log -- The list -- Adding data -- Leveling up -- Jumping around -- Thoughts and discussion -- Upsides -- Downsides -- Dynamic arrays -- Favorite transactions -- Internal arrays -- Quick access -- Wrap up -- Upsides -- Downsides -- Summary -- Further reading -- Chapter 15: Robust Trees -- Binary search tree -- IoT device management -- More devices -- Finding the right one -- Finding all devices -- Wrap up -- Upsides -- Downsides -- Red-black tree -- Better IoT device management -- Even more devices -- Balancing the tree -- Finding the right one, now -- Wrap up -- Upsides -- Downsides -- Heaps -- A huge inbox -- Getting messages in -- Taking messages out -- Wrap up -- Upsides -- Downsides -- Trie -- More realistic IoT device management -- Adding paths -- Walking -- Wrap up -- Upsides -- Downsides -- B-Tree -- An IoT database -- Adding stuff -- Searching for stuff -- Walking the tree -- Wrap up -- Upsides -- Downsides -- Graphs -- The literal Internet of Things -- Neighborhood search -- The shortest path -- Wrap up -- Upsides -- Downsides -- Summary -- Chapter 16: Exploring Maps and Sets -- Hashing -- Create your own -- Message digestion -- Wrap up -- Maps -- A location cache -- The hash function.
Adding locations.
Summary: This Learning Path is your easy reference to mastering Rust programming. It begins with an introduction to Rust data structures and algorithms and covers the entire spectrum, including memory safety, type system, concurrency, and other features of Rust 2018.
Tags from this library: No tags from this library for this title. Log in to add tags.
Star ratings
    Average rating: 0.0 (0 votes)
No physical items for this record

Cover -- Title Page -- Copyright -- 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 -- Hashmaps -- Slices -- 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 - imgtool -- Summary -- 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 simulator -- Continuous 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 syntax -- Exploring 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 -- Lifetimes -- Lifetime parameters -- Lifetime elision and the rules -- Lifetimes in user defined types -- Lifetime in impl blocks -- Multiple lifetimes -- Lifetime subtyping -- Specifying lifetime bounds on generic types -- Pointer types in Rust -- References - safe pointers -- Raw pointers -- Smart pointers -- Drop -- Deref and DerefMut -- Types of smart pointers -- Box&lt -- T&gt -- -- Reference counted smart pointers -- Rc&lt -- T&gt -- -- Interior mutability -- Cell&lt -- T&gt -- -- RefCell&lt -- T&gt -- -- Uses of interior mutability -- Summary -- Chapter 6: Error Handling.

Error handling prelude -- Recoverable errors -- Option -- Result -- Combinators on Option/Result -- Common combinators -- Using combinators -- Converting between Option and Result -- Early returns and the ? operator -- Non-recoverable errors -- User-friendly panics -- Custom errors and the Error trait -- Summary -- Chapter 7: Advanced Concepts -- Type system tidbits -- Blocks and expressions -- Let statements -- Loop as an expression -- Type clarity and sign distinction in numeric types -- Type inference -- Type aliases -- Strings -- Owned strings - String -- Borrowed strings - &amp -- str -- Slicing and dicing strings -- Using strings in functions -- Joining strings -- When to use &amp -- str versus String ? -- Global values -- Constants -- Statics -- Compile time functions - const fn -- Dynamic statics using the lazy_static! macro -- Iterators -- Implementing a custom iterator -- Advanced types -- Unsized types -- Function types -- Never type ! and diverging functions -- Unions -- Cow -- Advanced traits -- Sized and ?Sized -- Borrow and AsRef -- ToOwned -- From and Into -- Trait objects and object safety -- Universal function call syntax -- Trait rules -- Closures in depth -- Fn closures -- FnMut closures -- FnOnce closures -- Consts in structs, enums, and traits -- Modules, paths, and imports -- Imports -- Re-exports -- Selective privacy -- Advanced match patterns and guards -- Match guards -- Advanced let destructure -- Casting and coercion -- Types and memory -- Memory alignment -- Exploring the std::mem module -- Serialization and deserialization using serde -- Summary -- Chapter 8: Concurrency -- Program execution models -- Concurrency -- Approaches to concurrency -- Kernel-based -- User-level -- Pitfalls -- Concurrency in Rust -- Thread basics -- Customizing threads -- Accessing data from threads -- Concurrency models with threads.

Shared state model -- Shared ownership with Arc -- Mutating shared data from threads -- Mutex -- Shared mutability with Arc and Mutex -- RwLock -- Communicating through message passing -- Asynchronous channels -- Synchronous channels -- thread-safety in Rust -- What is thread-safety? -- Traits for thread-safety -- Send -- Sync -- Concurrency using the actor model -- Other crates -- Summary -- Chapter 9: Metaprogramming with Macros -- What is metaprogramming? -- When to use and not use Rust macros -- Macros in Rust and their types -- Types of macros -- Creating your first macro with macro_rules! -- Built-in macros in the standard library -- macro_rules! token types -- Repetitions in macros -- A more involved macro - writing a DSL for HashMap initialization -- Macro use case - writing tests -- Exercises -- Procedural macros -- Derive macros -- Debugging macros -- Useful procedural macro crates -- Summary -- Chapter 10: Unsafe Rust and Foreign Function Interfaces -- What is safe and unsafe really? -- Unsafe functions and blocks -- Unsafe traits and implementations -- Calling C code from Rust -- Calling Rust code from C -- Using external C/C++ libraries from Rust -- Creating native Python extensions with PyO3 -- Creating native extensions in Rust for Node.js -- Summary -- Chapter 11: Logging -- What is logging and why do we need it? -- The need for logging frameworks -- Logging frameworks and their key features -- Approaches to logging -- Unstructured logging -- Structured logging -- Logging in Rust -- log - Rust's logging facade -- The env_logger -- log4rs -- Structured logging using slog -- Summary -- Chapter 12: Network Programming in Rust -- Network programming prelude -- Synchronous network I/O -- Building a synchronous redis server -- Asynchronous network I/O -- Async abstractions in Rust -- Mio -- Futures -- Tokio.

Building an asynchronous redis server -- Summary -- Chapter 13: Building Web Applications with Rust -- Web applications in Rust -- Typed HTTP with Hyper -- Hyper server APIs - building a URL shortener -- hyper as a client - building a URL shortener client -- Web frameworks -- Actix-web basics -- Building a bookmarks API using Actix-web -- Summary -- Chapter 14: Lists, Lists, and More Lists -- Linked lists -- A transaction log -- Adding entries -- Log replay -- After use -- Wrap up -- Upsides -- Downsides -- Doubly linked list -- A better transaction log -- Examining the log -- Reverse -- Wrap up -- Upsides -- Downsides -- Skip lists -- The best transaction log -- The list -- Adding data -- Leveling up -- Jumping around -- Thoughts and discussion -- Upsides -- Downsides -- Dynamic arrays -- Favorite transactions -- Internal arrays -- Quick access -- Wrap up -- Upsides -- Downsides -- Summary -- Further reading -- Chapter 15: Robust Trees -- Binary search tree -- IoT device management -- More devices -- Finding the right one -- Finding all devices -- Wrap up -- Upsides -- Downsides -- Red-black tree -- Better IoT device management -- Even more devices -- Balancing the tree -- Finding the right one, now -- Wrap up -- Upsides -- Downsides -- Heaps -- A huge inbox -- Getting messages in -- Taking messages out -- Wrap up -- Upsides -- Downsides -- Trie -- More realistic IoT device management -- Adding paths -- Walking -- Wrap up -- Upsides -- Downsides -- B-Tree -- An IoT database -- Adding stuff -- Searching for stuff -- Walking the tree -- Wrap up -- Upsides -- Downsides -- Graphs -- The literal Internet of Things -- Neighborhood search -- The shortest path -- Wrap up -- Upsides -- Downsides -- Summary -- Chapter 16: Exploring Maps and Sets -- Hashing -- Create your own -- Message digestion -- Wrap up -- Maps -- A location cache -- The hash function.

Adding locations.

This Learning Path is your easy reference to mastering Rust programming. It begins with an introduction to Rust data structures and algorithms and covers the entire spectrum, including memory safety, type system, concurrency, and other features of Rust 2018.

Description based on publisher supplied metadata and other sources.

Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2024. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.

There are no comments on this title.

to post a comment.

© 2024 Resource Centre. All rights reserved.