Skip to content

Latest commit

 

History

History
112 lines (59 loc) · 3.94 KB

README.md

File metadata and controls

112 lines (59 loc) · 3.94 KB

Rust

Useful links

Learn Rust | official

The Book

Rust Std Library

Rust Reference

Rust Documentation

Rust by example

wasm

wasm-bingen lib/cli | official

Rust and WebAssembly | official

wasm-pack doc | official

tools

cargo-generate | GitHub

tuto

Rust for Javascripters | Coding Tech Youtube

learn Rust 30 minutes a day - good entry or refresh point

server in Rust

auth web microservice in rust

How to Build a REST API in Rust | Medium

web and api auth server in Rust | Medium (1)

sending mails with Rust (2)

User auth in Rust (3)

wasm

debugging Rust-generated WASM | official

TODO

the book
rust by example
rust 30 min a day
  • An impl block is always for a type, so, inside that block
rust & wasm

project : ./wasm/wasm-game-of-life/

commands

rustup update : update rust

cargo

cargo new --vcs=none [NAME] : creates a new cargo project and directory, the --vcs=none flag disable the creation of a git repo.

cargo check : check that the project compile.

cargo build : compile. The executable is located at ./target/debug/executable , it is possibel to run directly from it.

cargo run : compile and run

cargo build --release : build for release, removing code for error logging.

wasm-pack

wasm-pack build : compile the rust module to wasm.

wasm-pack test --chrome --headless : run tests. You can also use the --firefox, --safari, and --node options to test your code in those browsers.

wasm-pack build --debug : build package for debug.

General info

 ❮ onyr ★  kenzae❯ ❮ rust❯❯ rustc --version
rustc 1.48.0 (7eac88abb 2020-11-16)

Installation

Installing rust and rustup, the package and language manager is trivial. Follow instructions here. It's basically a one liner that does all the job.

VSCode

Use a rust-toolchain file to specify stable or nightly rust toolchain to be used by VSCode and Rust. More info here | StackOverflow.

You can also set VSCode user settings for using stable, read this | GitHub issue.