Effective Rust

35 Specific Ways to Improve Your Rust Code

Paperback Engels 2024 1e druk 9781098151409
€ 70,92
Levertijd ± 16 werkdagen
Gratis verzonden

Samenvatting

Rust's popularity is growing, due in part to features like memory safety, type safety, and thread safety. But these same elements can also make learning Rust a challenge, even for experienced programmers. This practical guide helps you make the transition to writing idiomatic Rust—while also making full use of Rust's type system, safety guarantees, and burgeoning ecosystem.

If you're a software engineer who has experience with an existing compiled language, or if you've struggled to convert a basic understanding of Rust syntax into working programs, this book is for you. By focusing on the conceptual differences between Rust and other compiled languages, and by providing specific recommendations that programmers can easily follow, Effective Rust will soon have you writing fluent Rust, not just badly translated C++.

- Understand the structure of Rust's type system
- Learn Rust idioms for error handling, iteration, and more
- Discover how to work with Rust's crate ecosystem
- Use Rust's type system to express your design
- Win fights with the borrow checker
- Build a robust project that takes full advantage of the Rust tooling ecosystem

Specificaties

ISBN13:9781098151409
Taal:Engels
Bindwijze:paperback
Aantal pagina's:250
Uitgever:O'Reilly
Druk:1
Verschijningsdatum:28-6-2024
Hoofdrubriek:IT-management / ICT

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Inhoudsopgave

Preface
Who This Book Is For
Rust Version
Navigating This Book
Conventions Used in This Book
O’Reilly Online Learning
How to Contact Us
Acknowledgments

1. Types
Item 1: Use the type system to express your data structures
Fundamental Types
Aggregate Types
enums
enums with Fields
Ubiquitous enum Types
Item 2: Use the type system to express common behavior
Functions and Methods
Function Pointers
Closures
Traits
Item 3: Prefer Option and Result transforms over explicit match expressions
Things to Remember
Item 4: Prefer idiomatic Error types
The Error Trait
Minimal Errors
Nested Errors
Trait Objects
Libraries Versus Applications
Things to Remember
Item 5: Understand type conversions
User-Defined Type Conversions
Casts
Coercion
Item 6: Embrace the newtype pattern
Bypassing the Orphan Rule for Traits
Newtype Limitations
Item 7: Use builders for complex types
Item 8: Familiarize yourself with reference and pointer types
Rust References
Pointer Traits
Fat Pointer Types
More Pointer Traits
Smart Pointer Types
Item 9: Consider using iterator transforms instead of explicit loops
Iterator Traits
Iterator Transforms
Iterator Consumers
Building Collections from Result Values
Loop Transformation
When Explicit Is Better

2. Traits
Item 10: Familiarize yourself with standard traits
Common Standard Traits
Standard Traits Covered Elsewhere
Operator Overloads
Summary
Item 11: Implement the Drop trait for RAII patterns
Item 12: Understand the trade-offs between generics and trait objects
Afgekapt op 60 regels

Managementboek Top 100

€ 70,92
Levertijd ongeveer 16 werkdagen
Gratis verzonden

Rubrieken

Producten

    Auteurs

      Trefwoorden

        Artikelen

          Effective Rust