Skip to content

victorskl/rust-tute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-tute

Assorted Rust tutes

Getting Started

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
which cargo
which rustc
which rustup
cargo --version
rustc --version
rustup update
mkdir hello_world
cd hello_world
vi main.rs
rustc main.rs
./main
rustc main.rs -o main.exe
./main.exe
cargo new --help
cargo new --vcs none hello-rust
cd hello-rust
cargo run
./target/debug/hello-rust
tree .

(add 'ferris-says = "0.2"' to dependencies section in Cargo.toml and correspondent code in main.rs)

cargo clean
cargo check
cargo build
cargo run
tree -L 2 target
cargo build --release
tree -L 2 target
./target/release/hello-rust

Recap

Using tool written in Rust

Just like others, such as yarn global add <foo> or npm -g install <bar> for some tool written in NodeJS eco-system; or pip install <foo> or pipx install <bar> for Python; or go get github.com/some/xtool for Go; etc... we can use Cargo install for some tool that is written in Rust.

cargo install --help
cargo help install

# e.g. WebSocket cli client
cargo search websocat
cargo install websocat
which websocat
websocat --help

Next

REF

Releases

No releases published

Packages

No packages published

Languages