2 options
Rust programming by example : enter the world of Rust by building engaging, concurrent, reactive, and robust applications / Guillaume Gomez, Antoni Boucher.
- Format:
- Book
- Author/Creator:
- Gomez, Guillaume, author.
- Boucher, Antoni, author.
- Language:
- English
- Subjects (All):
- Programming languages (Electronic computers)--Computer-assisted instruction.
- Programming languages (Electronic computers).
- Physical Description:
- 1 online resource (429 pages) : illustrations
- Edition:
- 1st ed.
- Place of Publication:
- Birmingham, England : Packt Publishing, 2018.
- Biography/History:
- Gomez Guillaume: Guillaume Gomez is an open source lover (let's keep this simple). He's a reviewer for the Rust language and a member of the GNOME organization. Guillaume lives in Paris, France. Boucher Antoni: Antoni Boucher has been enjoying programming for 10 years, especially functional and system programming. He works in the ad tech industry and strives to improve the performance and reliability of software. He contributes to multiple open source projects and is interested in system programming and compilers. Antoni lives in Montreal, Canada.
- Summary:
- Rust is an open source, safe, concurrent, practical language created by Mozilla. It runs blazingly fast, prevents segfaults, and guarantees safety. This book gets you started with essential software development by guiding you through the different aspects of Rust programming. With this approach, you can bridge the gap between learning and.
- Contents:
- Intro
- Cover
- Copyright and Credits
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Basics of Rust
- Getting to know Rust
- Installing Rust
- Windows
- Linux/Mac
- Test your installation
- Documentation and reference
- Main function
- Variables
- Built-in data types
- Integer types
- Floating-point types
- Boolean type
- Character type
- Control flow
- Writing a condition
- Creating while loops
- Creating functions
- Creating structures
- References
- Clone types
- Copy types
- Mutable references
- Methods
- Constructors
- Tuples
- Enumerations
- Pattern matching
- Irrefutable patterns
- Traits
- Default methods
- Associated types
- Rules
- Generics
- The Option type
- Arrays
- Slices
- For loops
- Macros
- Multiple pattern rules
- Repetitions
- Optional quantifier
- Summary
- Chapter 2: Starting with SDL
- Understanding Rust crates
- Installing SDL2
- Installing SDL2 on Linux
- Installing SDL2 on Mac
- Installing SDL2 on Windows
- Windows with Build Script
- Windows (MinGW)
- Windows (MSVC)
- Setting up your Rust project
- Cargo and crates.io
- The docs.rs documentation
- Back to our Cargo.toml file
- Rust's modules
- Tetris
- Creating a window
- Drawing
- Playing with Options
- Solution
- Loading images
- Installing SDL2_image on Mac
- Installing SDL2_image on Linux
- Installing SDL2_image on Windows
- Playing with features
- Playing with images
- Handling files
- Saving/loading high scores
- Iterators
- Reading formatted data from files
- Chapter 3: Events and Basic Game Mechanisms
- Writing Tetris
- Tetrimino
- Creating tetriminos
- Generating a tetrimino
- Rotating a tetrimino
- Tetris struct
- Interacting with the game map
- SDL events
- Score, level, lines sent
- Levels and lines sent.
- Highscores loading/overwriting
- Chapter 4: Adding All Game Mechanisms
- Getting started with game mechanisms
- Rendering UI
- Rendering initialization
- Rendering
- Playing with fonts
- Install on OS X
- Install on Linux
- Other system/package manager
- Loading font
- Chapter 5: Creating a Music Player
- Installing the prerequisite
- Installing GTK+ on Linux
- Installing GTK+ on Mac
- Installing GTK+ on Windows
- Creating your first window
- Closure
- Preventing the default behavior of an event
- Creating a toolbar
- Stock item
- Improving the organization of the application
- Adding tool button events
- Lifetime
- Ownership
- Containers
- Types of containers
- The Box container
- Adding a playlist
- The MVC pattern
- Opening MP3 files
- Reference-counting pointer
- ID3- MP3 metadata
- Opening files with a file dialog
- Deleting a song
- Displaying the cover when playing a song
- Chapter 6: Implementing the Engine of the Music Player
- Installing the dependencies
- Installing dependencies on Linux
- Installing dependencies on Mac
- Installing dependencies on Windows
- Decoding MP3 files
- Adding dependencies
- Implementing an MP3 decoder
- Getting the frame samples
- Playing music
- Event loop
- Atomic reference counting
- Mutual exclusion
- Send trait
- Sync trait
- Lock-free data structures
- Mutex guard
- RAII
- Using the music player
- Pausing and resuming the song
- Interior mutability
- Showing the progression of the song
- Improving CPU usage
- Condition variable
- Showing the song's current time
- Loading and saving the playlist
- Saving a playlist
- Loading a playlist
- Using gstreamer for playback
- Chapter 7: Music Player in a More Rusty Way with Relm
- Reasons to use relm instead of gtk-rs directly.
- State mutation
- Asynchronous user interface
- Creating custom widgets
- Creating a window with relm
- Installing Rust nightly
- Widget
- Model
- Messages
- View
- Properties
- Events
- Code generation
- Update function
- Adding child widgets
- One-way data binding
- Post-initialization of the view
- Dialogs
- Other methods
- Playlist
- Model parameter
- Adding a relm widget
- Communicating between widgets
- Communicating with the same widget
- Emit
- With different widgets
- Handle messages from a relm widget
- Syntax sugar to send a message to another relm widget
- Computing the song duration
- Using relm on stable Rust
- Relm widgets data binding
- Chapter 8: Understanding FTP
- File transfer protocol
- Introduction to FTP
- Implementing simple chunks of commands
- Starting with basics
- Commands implementation
- Implementing the SYST command
- Implementing the USER command
- Implementing the NOOP command
- Implementing the PWD command
- Implementing the TYPE command
- Implementing the LIST command
- Implementing the PASV command
- Back to the LIST command
- Implementing the CWD command
- Implementing the CDUP command
- Full implementation of the LIST command
- Implementing the MKD command
- Implementing the RMD command
- Testing it
- Chapter 9: Implementing an Asynchronous FTP Server
- Advantages of asynchronous IO
- Disadvantages of asynchronous IO
- Creating the new project
- Using Tokio
- Tokio event loop
- Using futures
- Handling errors
- Unwrapping
- Custom error type
- Displaying the error
- Composing error types
- The ? operator, revisited
- Starting the Tokio event loop
- Starting the server
- Handling clients
- Handling commands
- FTP codec
- Decoding FTP commands
- Encoding FTP commands
- Handling commands.
- Managing the current working directory
- Printing the current directory
- Changing the current directory
- Setting the transfer type
- Entering passive mode
- Bytes codec
- Decoding data bytes
- Encoding data bytes
- Quitting
- Creating directories
- Removing directories
- Chapter 10: Implementing Asynchronous File Transfer
- Listing files
- Downloading a file
- Uploading files
- Going further!
- Configuration
- Securing the config.toml access
- Unit tests
- Backtraces
- Testing failures
- Ignoring tests
- Integration tests
- Teardown
- Print output to stdout
- Documentation
- Documenting a crate
- Documenting a module
- Headers
- Code blocks
- Documenting an enumeration (or any type with public fields)
- Generating the documentation
- Warning about public items without documentation
- Hiding items from the documentation
- Documentation tests
- Tags
- ignore
- compile_fail
- no_run
- should_panic
- Combining flags?
- About the doc blocks themselves
- Hiding code blocks lines
- Fuzzing tests
- Chapter 11: Rust Best Practices
- Rust best practices
- API tips and improvements
- Explaining the Some function
- Using the Path function
- Usage tips
- Builder pattern
- Playing with mutable borrows
- Playing with moves
- Code readability
- Big number formatting
- Specifying types
- Matching
- Chapter 12: Other Books You May Enjoy
- Index.
- Notes:
- Includes index.
- Description based on online resource; title from PDF title page (EBC, viewed February 22, 2018).
- OCLC:
- 1463580489
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.