Rust Language Learning material
- Rust is blazingly fast systems programming language that prevents segfaults and guarantees thread safety.
- Originally Rust was designed by Graydon Hoare, Now it managed by Rust project developers.
- The first version of Rust was released in the year 2010.
- Rust is syntactically similar to C++.
- zero-cost abstractions
- move semantics
- guaranteed memory safety
- threads without data races
- trait-based generics
- pattern matching
- type inference
- minimal runtime
- efficient C bindings
- Rust uses a static garbage collector.
- It works on the principle of automatic memory management which means it automatically recycles the memory that will not be used again.
- 360dialog
- OneSignal
- Coursera
- Atlassian
- Braintree
- npm, Inc
- Mozilla
- Academia.edu
- Xero
- It's a build system and package manager built for Rust users to manager projects in it.
- The Cargo system manages three things for users, building code, downloading the libraries, and rebuilding those libraries.
- When a user runs cargo build command it automatically creates a file named as Cargo.lock to keep track of dependencies in the user application.
cargo new
cargo build
cross compilation to linux is achieved by running
cargo build --target x86_64-unknown-linux-musl
To cross compile to a static Linux binary, install
rust-std-linux
cargo test
cargo run
cargo fmt
cargo clippy
cargo vendor
- Tokio : Asynchronous run-time for Rust
- Hyper : fast, safe HTTP implementation written in and for Rust
- Tower : Library for modular and reusable components for building robust networking clients & servers.
rustup.rs
This repository contains learning material for Rust. The examples and runnable demos are located in the 00_Demo/ folder (a small Cargo project).
Install Rust using the recommended rustup tool. These steps work on most Linux distributions.
- Install rustup (official installer):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFollow the interactive prompt (choose the default 'stable' toolchain). After installation, reload your shell or run:
source "$HOME/.cargo/env"- Verify Rust and Cargo are installed:
rustc --version
cargo --version- Install recommended developer tools used in this repo (optional but useful):
rustup component add rustfmt clippy rust-src
cargo install cargo-edit cargo-watch- Run the demo examples (from repository root):
cd 00_Demo
cargo run --bin hello_worldNotes:
- The
00_Demo/directory is a standalone Cargo crate containing multiple example binaries in00_Demo/src/bin/. - Use
cargo run --bin <name>to execute a specific example, orcargo build --releaseto produce optimized artifacts.