The Rust Programming Language (Covers Rust 2018)

Couverture
No Starch Press, 12 août 2019 - 560 pages
The official book on the Rust programming language, written by the Rust development team at the Mozilla Foundation, fully updated for Rust 2018.

The Rust Programming Language is the official book on Rust: an open source systems programming language that helps you write faster, more reliable software. Rust offers control over low-level details (such as memory usage) in combination with high-level ergonomics, eliminating the hassle traditionally associated with low-level languages.

The authors of The Rust Programming Language, members of the Rust Core Team, share their knowledge and experience to show you how to take full advantage of Rust's features--from installation to creating robust and scalable programs. You'll begin with basics like creating functions, choosing data types, and binding variables and then move on to more advanced concepts, such as:


  • Ownership and borrowing, lifetimes, and traits
  • Using Rust's memory safety guarantees to build fast, safe programs
  • Testing, error handling, and effective refactoring
  • Generics, smart pointers, multithreading, trait objects, and advanced pattern matching
  • Using Cargo, Rust's built-in package manager, to build, test, and document your code and manage dependencies
  • How best to use Rust's advanced compiler with compiler-led programming techniques

  • You'll find plenty of code examples throughout the book, as well as three chapters dedicated to building complete projects to test your learning: a number guessing game, a Rust implementation of a command line tool, and a multithreaded server.

    New to this edition: An extended section on Rust macros, an expanded chapter on modules, and appendixes on Rust development tools and editions.
     

    Table des matières

    Processing a Series of Items with Iterators
    276
    Improving Our IO Project
    283
    Summary
    289
    More About Cargo and Crates io
    291
    Cargo Workspaces
    303
    Smart Pointers
    311
    Treating Smart Pointers Like Regular References with the Deref Trait
    317
    Running Code on Cleanup with the Drop Trait
    323

    Comments
    49
    Summary
    57
    Understanding Ownership
    59
    References and Borrowing
    70
    Using Structs to Structure Related Data
    83
    Method Syntax
    92
    Enums and Pattern Matching
    97
    Defining an Enum
    98
    The match Control Flow Operator
    104
    Summary
    110
    Managing Growing Projects with Packages Crates and Modules
    111
    Bringing Paths into Scope with the use Keyword
    121
    Summary
    128
    Common Collections
    131
    Storing UTF8 Encoded Text with Strings
    137
    Error Handling
    151
    To panic or Not to panic
    164
    Generic Types Traits and Lifetimes
    171
    Defining Shared Behavior
    182
    Validating References with Lifetimes
    192
    Generic Type Parameters Trait Bounds and Lifetimes Together
    205
    Writing Automated Tests
    207
    Test Organization
    227
    An IO Project Building a Command Line Program
    233
    Developing the Librarys Functionality with TestDriven Development
    250
    Writing Error Messages to Standard Error Instead of Standard Output
    260
    Functional Language Features Iterators and Closures
    263
    RefCellT and the Interior Mutability Pattern
    330
    Reference Cycles Can Leak Memory
    339
    Summary
    346
    Fearless Concurrency
    347
    Using Message Passing to Transfer Data Between Threads
    355
    SharedState Concurrency
    361
    Summary
    370
    ObjectOriented Programming Features of Rust
    371
    Patterns and Matching
    395
    Whether a Pattern Might Fail to Match
    401
    Summary
    416
    Advanced Features
    417
    Advanced Traits
    427
    Advanced Types
    437
    Advanced Functions and Closures
    443
    Final Project Building a Multithreaded Web Server
    457
    Turning Our SingleThreaded Server into a Multithreaded Server
    468
    Graceful Shutdown and Cleanup
    487
    Summary
    493
    Keywords
    495
    Operators and Symbols
    499
    Derivable Traits
    507
    Useful Development Tools
    511
    Fix Your Code with rustfix
    512
    Editions
    515
    Index
    517
    Droits d'auteur

    Autres éditions - Tout afficher

    Expressions et termes fréquents

    À propos de l'auteur (2019)

    Steve Klabnik is the Community Team Leader for the Rust team at Mozilla, in charge of official Rust community documentation as well as the key Rust community advocate. Klabnik is a frequent speaker at conferences and one of the world's most prolific contributors to Rails projects.

    Carol Nichols is a member of the Rust Community Team. She's been active in the Rust community and is an organizer of the Rust Belt Rust Conference.

    Informations bibliographiques