Quickly learn the ropes with the Rust programming language using this practical, step-by-step guide
In Beginning Rust Programming, accomplished programmer and author Ric Messier delivers a highly practical, real-world guide to coding with Rust. Avoiding dry, theoretical content and “Hello, world”-type tutorials of questionable utility, the book dives immediately into functional Rust programming that takes advantage of the language’s blazing speed and memory efficiency.
Designed from the ground up to give you a running start to using the multiparadigm system programming language, this book will teach you to:
- Solve real-world computer science problems of practical importance
- Use Rust’s rich type system and ownership model to guarantee memory-safety and thread-safety
- Integrate Rust with other programming languages and use it for embedded devices
Perfect for programmers with some experience in other languages, like C or C++, Beginning Rust Programming is also a great pick for students new to programming and seeking a user-friendly and robust language with which to start their coding career.
Author(s): Ric Messier
Edition: 1
Publisher: Wiley
Year: 2021
Language: English
Commentary: Vector PDF
Pages: 416
City: Indianapolis, IN
Tags: Machine Learning; Programming; Databases; Concurrency; SQL; Relational Databases; NoSQL; MongoDB; HTTP; Logging; Microservices; Encryption; Recursion; Raspberry Pi; Network Programming; Game of Life; Unit Testing; Web Servers; Rust; TCP; Clients; Servers
Cover
Title Page
Copyright Page
Contents
Introduction
Obtaining Rust
Getting the Source Code
What You Will Learn
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Providing Feedback
Chapter 1 Game of Life: The Basics
Game of Life: The Program
Starting with Cargo
Putting the Pieces Together
Bringing In External Functionality
Namespaces
Generating the Game Grid
Dissecting Main
Defining Functions
Defining Variables
Datatypes
Arrays
Control Structures
Looking at More Function Functions
Returning Values
Passing Parameters
Scope
Compiling Programs
Summary
Exercises
Additional Resources
Chapter 2 Extended Life
Understanding Ownership
Extending Life
Adding Modules
Working with Command-Line Arguments
Option Types
Reading from Files
Extracting Values
Populating from the Vector
Outputting to the Terminal
Using Colors
Printing Generations
Summary
Exercises
Additional Resources
Chapter 3 Building a Library
References
First Pass
Traits and Implementations
Self-Identification
The Rest
Second Pass
The Driver
Summary
Exercises
Additional Resources
Chapter 4 Hangman
Our Data
The Traits
Implementations
Using the Option Enum
Finishing Up the Implementation
Reading Files and Selecting Words
Handling Errors Concisely
Generics and Bounds
A Vector of Lines
The Rest of the Story
Initialization
Playing the Game
Summary
Exercises
Additional Resources
Chapter 5 In Concurrence
The Dining Philosophers
Mutexes and Semaphores
Interprocess Communications
The Main Event
Unix Sockets
File and Directory Handling
Closures
Threading in the Main
Creating Streams
Cryptographic Hashing
Creating Threads
Summary
Exercises
Additional Resources
Chapter 6 Clients and Servers
Planning
Network Programming
Programming Sockets
Rust TCP Server
Handling Requests
Operating System Calls
Summary
Exercises
Additional Resources
Chapter 7 Client-Side Applications
Encryption
Encryption Algorithms
Going Hybrid
Encryption Algorithms
Transport Layer Security (TLS)
TLS Server
Remote Access Client
Creating the Connection
Validating Input
Regular Expressions
The Final Function
Summary
Exercises
Additional Resources
Chapter 8 Going Relational
Application Architectures
n-Tier Applications
Microservices
Model-View-Controller
Databases
Structured Query Language
Server or Embedded
Accessing Databases
Writing a Database Program
Main and Modules
Database Functions
Adding Records
Listing Records
Summary
Exercises
Additional Resources
Chapter 9 No(SQL) Going
Assertions
Design by Contract
NoSQL
Working with MongoDB
Inserting Data
Reading in Data from a File
Populating the Database
Retrieving Values
Summary
Exercises
Additional Resources
Chapter 10 Web Communications
Style Guides
Hypertext Transfer Protocol
Programmatic Communication
Web Communication Over TLS
Client Communication
Jumping Ahead
Jumping Back
Summary
Exercises
Additional Resources
Chapter 11 Web Server
Offensive vs. Defensive Programming
Web Application Communications
Web Application Parameters
Asynchronous JavaScript and XML
Representational State Transfer
APIs in Node.js and Python
API Server in Rust
Rust Rocket
Summary
Exercises
Additional Resources
Chapter 12 Getting to the System
Extending Functionality
Windows Registry
Programmatic Access to the Registry
Using Rust to Access the Registry
System Information with Rust
Persistence (for Fun)
Summary
Exercises
Additional Resources
Chapter 13 Device Programming
Logging
Using syslog
Using Windows Event Logs
Working with Raspberry Pi
Lighting Lights
Reading GPIO
Summary
Exercises
Additional Resources
Chapter 14 Collecting Stuff
Arrays and Vectors
Linked Lists
Stacks
Queues
Sorting
Search Trees
Summary
Exercises
Additional Resources
Chapter 15 Odds and Sods
Unit Testing
Testing Types
Test Plans
Unit Tests
Recursion
Machine Learning
Chatbots
Neural Networks
Summary
Exercises
Additional Resources
Index
EULA