conalryan/rust-notes

Rustup: the Rust installer and version management tool

To test that you have Rust and Cargo installed, you can run this in your terminal of choice: cargo --version

Rust

Install

curl https://sh.rustup.rs -sSf | sh

Toolchain Management rustup

  • Rapid 6-week release cycle
  • rustup update

Configuring the PATH environment variable

  • All tools are installed to the ~/.cargo/bin directory (Rust toolchain: including rustc, cargo, and rustup).
  • Include this directory in their PATH environment variable.

Test installation

rustc --version

Cargo: the Rust build tool and package manager

When you install Rustup you’ll also get the latest stable version of the Rust build tool and package manager, also known as Cargo. Cargo does lots of things:

  • build your project with cargo build
  • check for build errors cargo check
  • run your project with cargo run
  • test your project with cargo test
  • build documentation for your project with cargo doc
  • get all documentation for dependencies cargo doc --open
  • publish a library to crates.io with cargo publish
  • To test that you have Rust and Cargo installed, you can run this in your terminal of choice: cargo --version

Code formatting tool Rustfmt

rustup component add rustfmt

Linting tool Clippy

rustup component add clippy

Hello World

cargo new hello-rust
cargo run

Dependencies

  • Managed via Cargo.toml
  • Libraries found on crates.io, the pakcage registry for Rust.
  • Packages refered to as "crates."

Add ferris-says

[dependencies]
ferris-says = "0.1"

Add this dependency to main.rs

use ferris_says::say;

We can now use the say function that ferris-says crate exports.

Information - Updated Aug 10, 2022

Stars: 1
Forks: 0
Issues: 3

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

web-library-rust

A basic CRUD application that represents books in a library

web-library-rust
Facebook Instagram Twitter GitHub Dribbble
Privacy