56 lines
842 B
Markdown
56 lines
842 B
Markdown
Open book of rust
|
|
`rustup doc --book`
|
|
|
|
Open std crate docs page
|
|
`rustup doc std`
|
|
|
|
Open vec in std crate docs page
|
|
`rustup doc std::vec`
|
|
|
|
Compile
|
|
`rustc <filename>.rs`
|
|
|
|
Create package
|
|
`cargo new 01`
|
|
|
|
Search cargo crates
|
|
`cargo search`
|
|
|
|
Add crate
|
|
`cargo add {crate}`
|
|
|
|
Build/run
|
|
`cargo build`
|
|
`cargo run`
|
|
|
|
Setup
|
|
```
|
|
cargo new lectures/01 --name lec01
|
|
cargo new lectures/02 --name lec02
|
|
cargo new lectures/03 --name lec03
|
|
|
|
cargo new labs/01 --name lab01
|
|
cargo new labs/02 --name lab02
|
|
```
|
|
|
|
## wasm stuff
|
|
```
|
|
cargo install wasm-pack
|
|
wasm-pack new {name}
|
|
wasm-pack build --target web
|
|
```
|
|
|
|
|
|
## Phoenix Framework
|
|
```
|
|
# no database
|
|
mix phx.new hello --no-ecto
|
|
# can be --no-html --no-mailer --no-assets
|
|
|
|
iex -S mix phx.server # run in interactive shell
|
|
|
|
mix phx.routes # routes
|
|
|
|
/dev/dashboard/home # view phoenix framework dashboard when running
|
|
```
|