- Why Rust?
- On language comparisons
- Language features
- Performance
- Type system
- Memory safety
- Fearless concurrency
- C interoperability
- Ecosystem
- The nature of programming
- Fun
- Why not Rust
- This book’s mission
- Setting expectations based on your background
- Getting your environment setup
- Rustup
- Cargo
- IDEs, RLS, Editors
- Clippy
- Rustfmt
- Documentation
- The Nomicon
- Getting started
- Binary vs. library
- The generated project
- main.rs
- Cargo.toml
- Crates
- Making our crate a library
- Trade-offs
- Print a list of numbers
- Iteration
- Defining Array Types
- Using std::vec::Vec
- Function Arguments
- A type signature that works for both arrays and vectors
- Constructing A Vector of Numbers
- A Shorter Version with collect
- Testing our code
- Wrapping up
- Web Ecosystem
- Hyper
- Actix
- Rocket
- Others
- Starting out
- Getting the structure in place
- Aggregate data types
- Result
- Ok
- Basic logging setup
- Starting the app
- Handling our first request
- Creating our app
- Adding behavior to our data
- Self is special
- Create a MessageApp
- Instance methods
- All of the selfs
- Running our server
- Understanding closures
- Syntax for working with Results
- Creating our handler
- Attributes
- How handlers work in Rust
- Working with Options
- Example requests
- Summary
- Recap and overview
- Adding state
- Static versus const
- Defining our state
- Sharing across threads
- Extracting data from requests
- Effectively working with locks
- Responding with data
- Constructing our state
- Example requests
- Receiving input
- Example requests
- Custom error handling
- Generic return types
- Creating useful errors
- Interpreting compiler errors
- Example requests
- Handling path variables
- Example requests
- Wrapping up
- Crates to know
- Diesel
- Building a blog
- Getting setup
- Installing the Diesel CLI
- Migrations
- Running migrations
- Schema
- Users
- Create users migration
- Make username unique
- Schema
- Building the application
- Main
- Setting up our library
- Modules and code organization
- Application struct
- Errors
- From and Into
- Errors as responses
- Models
- User struct
- Create User
- Fetching a user
- Routes
- Routes for a user
- Create a user
- Find a user
- Wiring the routes up
- Examples
- Create a new user
- Create another new user
- Create a new user already exists
- Lookup user by name
- Lookup user by primary key
- Lookup user by name that doesn't exist
- Extending our application
- Extending the data model
- Post model
- Creating a post
- Publish a post
- Retrieve posts
- Adding routes for posts
- Creating a post
- Publishing a post
- Fetching posts
- Wiring up our routes
- Extending further: comments
- Modifying the model
- Generated schema
- Comment model
- Creating a comment
- Getting comments on a post
- Getting all comments by a user
- Including comments in our post fetching functions
- Adding routes for comments
- Creating a comment
- Getting all comments on a post
- Getting all comments by a user
- Wiring the routes up
- Create a post
- Create a post
- Publish a post
- Comment on a post
- List all posts
- See posts
- Publish other post
- List all posts again
- See users comments
- See post comments
- Wrapping up
- Initial setup
- Making an MVP
- Basic feature set
- Building the features
- The main entry point: main.rs
- The application module
- The client module
- The errors module
- Recap
- Adding a configuration file
- Changes to main
- Adding the configuration to our app
- The config module
- The directories module
- Adding sessions
- Adding the session to main
- Supporting sessions in the app module
- Adding sessions to the client
- Implementing sessions
- Session recap
- Syntax highlighting
- Adding highlighting to main
- Supporting syntax highlighting errors
- The syntax module
- Summary
- Overview
- Declarative Macros
- Expanding a macro
- More information
- Procedural Macros
- Custom derive
- Attribute-like
- Function-like
- Writing a custom derive
- Motivation
- Initial setup
- Building the scaffold
- Friendly error handling
- Getting into the parser
- Handling attributes
- Finishing up the parsing
- Generating code
- Using our custom derive
- Wrapping up
Fullstack Rust
Chapter 1:
Introduction
Chapter 2:
Making Your First Rust App
Chapter 3:
Making A Web App With Actix
Chapter 4:
Adding State to Our Web App
Chapter 5:
Even More Web
Chapter 7:
Command Line Applications
Chapter 8:
Macros
Â
This page is a preview of Fullstack Rust