Rust Essentials

Discover how to use Rust to write fast, secure, and concurrent systems and applications
Preview in Mapt

Rust Essentials

Ivo Balbaert

1 customer reviews
Discover how to use Rust to write fast, secure, and concurrent systems and applications
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.80
RRP $23.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.80
$29.99
$29.99p/m after trial
RRP $23.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Rust Essentials Book Cover
Rust Essentials
$ 23.99
$ 16.80
Rust Essentials - Second Edition Book Cover
Rust Essentials - Second Edition
$ 35.99
$ 25.20
Buy 2 for $34.30
Save $25.68
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785285769
Paperback184 pages

Book Description

Starting by comparing Rust with other programming languages, this book will show you where and how to use Rust. It will discuss primitive types along with variables and their scope, binding and casting, simple functions, and ways to control execution flow in a program.

Next, the book covers flexible arrays, vectors, tuples, enums, and structs. You will then generalize the code with higher-order functions and generics applying it to closures, iterators, consumers, and so on. Memory safety is ensured by the compiler by using references, pointers, boxes, reference counting, and atomic reference counting. You will learn how to build macros and crates and discover concurrency for multicore execution.

By the end of this book, you will have successfully migrated to using Rust and will be able to use it as your main programming language.

Table of Contents

Chapter 1: Starting with Rust
The advantages of Rust
The trifecta of Rust – safety, speed, and concurrency
Using Rust
Installing Rust
The Rust compiler – rustc
Our first program
Working with Cargo
The developer tools
Summary
Chapter 2: Using Variables and Types
Comments
Global constants
Values and primitive types
Binding variables to values
Scope of a variable and shadowing
Type checking and conversions
Expressions
The stack and the heap
Summary
Chapter 3: Using Functions and Control Structures
Branching on a condition
Looping
Functions
Attributes
Testing
Summary
Chapter 4: Structuring Data and Matching Patterns
Strings
Arrays, vectors, and slices
Tuples
Structs
Enums
Getting input from the console
Matching patterns
Summary
Chapter 5: Generalizing Code with Higher-order Functions and Parametrization
Higher-order functions and closures
Iterators
Consumers and adapters
Generic data structures and functions
Error handling
Methods on structs
Traits
Using trait constraints
Built-in traits and operator overloading
Summary
Chapter 6: Pointers and Memory Safety
Pointers and references
Ownership and borrowing
Boxes
Reference counting
An overview of pointers
Summary
Chapter 7: Organizing Code and Macros
Modules and crates
Macros
Summary
Chapter 8: Concurrency and Parallelism
Concurrency and threads
The shared mutable state
Communication through channels
Summary
Chapter 9: Programming at the Boundaries
Program arguments
Unsafe code
Raw pointers
Interfacing with C
Calling Rust from other languages
Summary

What You Will Learn

  • Set up your Rust environment for maximum productivity
  • Bridge the performance gap between safe and unsafe languages with Rust
  • Use pattern matching to create flexible code
  • Apply generics and traits to develop widely applicable code
  • Organize your code in modules and crates
  • Build macros to extend Rust's capabilities and reach
  • Apply threads to tackle problems concurrently and in distributed environments
  • Interface with C and isolate unsafe code

Authors

Table of Contents

Chapter 1: Starting with Rust
The advantages of Rust
The trifecta of Rust – safety, speed, and concurrency
Using Rust
Installing Rust
The Rust compiler – rustc
Our first program
Working with Cargo
The developer tools
Summary
Chapter 2: Using Variables and Types
Comments
Global constants
Values and primitive types
Binding variables to values
Scope of a variable and shadowing
Type checking and conversions
Expressions
The stack and the heap
Summary
Chapter 3: Using Functions and Control Structures
Branching on a condition
Looping
Functions
Attributes
Testing
Summary
Chapter 4: Structuring Data and Matching Patterns
Strings
Arrays, vectors, and slices
Tuples
Structs
Enums
Getting input from the console
Matching patterns
Summary
Chapter 5: Generalizing Code with Higher-order Functions and Parametrization
Higher-order functions and closures
Iterators
Consumers and adapters
Generic data structures and functions
Error handling
Methods on structs
Traits
Using trait constraints
Built-in traits and operator overloading
Summary
Chapter 6: Pointers and Memory Safety
Pointers and references
Ownership and borrowing
Boxes
Reference counting
An overview of pointers
Summary
Chapter 7: Organizing Code and Macros
Modules and crates
Macros
Summary
Chapter 8: Concurrency and Parallelism
Concurrency and threads
The shared mutable state
Communication through channels
Summary
Chapter 9: Programming at the Boundaries
Program arguments
Unsafe code
Raw pointers
Interfacing with C
Calling Rust from other languages
Summary

Book Details

ISBN 139781785285769
Paperback184 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Go Programming Blueprints Book Cover
Go Programming Blueprints
$ 29.99
$ 21.00
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Functional Python Programming Book Cover
Functional Python Programming
$ 29.99
$ 21.00
Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Mastering Concurrency in Go Book Cover
Mastering Concurrency in Go
$ 30.99
$ 21.70