
Rust Essentials
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
All prices
More details
Person
Ivo Balbaert is a lecturer in web programming and databases at CVO Antwerpen, a community college in Belgium. He received a PhD in applied physics from the University of Antwerp in 1986. He worked for 20 years in the software industry as a developer and consultant in several companies, and for 10 years as project manager at the University Hospital of Antwerp. From 2000 onwards, he switched to partly teaching and partly developing software (at KHM Mechelen, CVO Antwerpen). He also wrote an introductory book in Dutch about developing in Ruby and Rails, Programmeren met Ruby en Rails, published by Van Duuren Media. In 2012, he authored a book on the Go programming language, The Way to Go, published by iUniverse. He has written a number of introductory books for new programming languages, notably Dart, Julia, Rust, and Red, all published by Packt.
Content
- Cover
- Title Page
- Copyright
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Starting with Rust
- The advantages of Rust
- The trifecta of Rust - safe, fast, and concurrent
- Comparison with other languages
- The stability of Rust and its evolution
- The success of Rust
- Where to use Rust
- Servo
- Installing Rust
- rustc--the Rust compiler
- Our first program
- Working with Cargo
- Developer tools
- Using Sublime Text
- The Standard Library
- Summary
- Chapter 2: Using Variables and Types
- Comments
- Global constants
- Printing with string interpolation
- Values and primitive types
- Consulting Rust documentation
- Binding variables to values
- Mutable and immutable variables
- Scope of a variable and shadowing
- Type checking and conversions
- Aliasing
- Expressions
- The stack and the heap
- Summary
- Chapter 3: Using Functions and Control Structures
- Branching on a condition
- Looping
- Functions
- Documenting a function
- Attributes
- Conditional compilation
- Testing
- Testing with cargo
- The tests module
- Summary
- Chapter 4: Structuring Data and Matching Patterns
- Strings
- Arrays, vectors, and slices
- Vectors
- Slices
- Strings and arrays
- Tuples
- Structs
- Enums
- Result and Option
- Getting input from the console
- Matching patterns
- Program arguments
- Summary
- Chapter 5: Higher Order Functions and Error-Handling
- Higher order functions and closures
- Iterators
- Consumers and adapters
- Generic data structures and functions
- Error-handling
- Panics
- Testing for failure
- Some more examples of error-handling
- The try! macro and the ? operator
- Summary
- Chapter 6: Using Traits and OOP in Rust
- Associated functions on structs
- Methods on structs
- Using a constructor pattern
- Using a builder pattern
- Methods on tuples and enums
- Traits
- Using trait constraints
- Static and dynamic dispatch
- Built-in traits and operator overloading
- OOP in Rust
- Inheritance with traits
- Using the visitor pattern
- Summary
- Chapter 7: Ensuring Memory Safety and Pointers
- Pointers and references
- Stack and heap
- Lifetimes
- Copying and moving values - The copy trait
- Let's summarize
- Pointers
- References
- Match, struct, and ref
- Ownership and borrowing
- Ownership
- Moving a value
- Borrowing a value
- Implementing the Drop trait
- Moving closure
- Boxes
- Reference counting
- Overview of pointers
- Summary
- Chapter 8: Organizing Code and Macros
- Modules and crates
- Building crates
- Defining a module
- Visibility of items
- Importing modules and file hierarchy
- Importing external crates
- Exporting a public interface
- Adding external crates to a project
- Working with random numbers
- Macros
- Why macros?
- Developing macros
- Repetition
- Creating a new function
- Some other examples
- Using macros from crates
- Some other built-in macros
- Summary
- Chapter 9: Concurrency - Coding for Multicore Execution
- Concurrency and threads
- Creating threads
- Setting the thread's stack size
- Starting a number of threads
- Panicking threads
- Thread safety
- Shared mutable states
- The Sync trait
- Communication through channels
- Sending and receiving data
- Making a channel
- Sending struct values over a channel
- Sending references over a channel
- Synchronous and asynchronous
- Summary
- Chapter 10: Programming at the Boundaries
- When is code unsafe
- Using std::mem
- Raw pointers
- Interfacing with C
- Using a C library
- Inlining assembly code
- Calling Rust from other languages
- Summary
- Chapter 11: Exploring the Standard Library
- Exploring std and the prelude module
- Collections - using hashmaps and hashsets
- Working with files
- Paths
- Reading a file
- Error-handling with try!
- Buffered reading
- Writing a file
- Error-handling with try!
- Filesystem operations
- Using Rust without the Standard Library
- Summary
- Chapter 12: The Ecosystem of Crates
- The ecosystem of crates
- Working with dates and times
- File formats and databases
- Web development
- Graphics and games
- OS and embedded system development
- Other resources for learning Rust
- Summary
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.