- Frontend
Alice
want to buildweb app
. //main
, todomvc,wasm
, yew, github page - Backend
Bob
want to buildRESTful API
for Alice. //lib
, actix - React Frontend
Cat
want to buildwasm
to use withReactJS
. //wasm
,wasm-bindgen
- SmartContract Developer
Dog
want to build smart contract. //solana
,anchor
- Artist
Elephant
want to createNFT
. //metaplex
,sugar
- Trainer
Fox
want to create ticketNFT
. //cardinal
- Attendee
Giraffe
want to use rentedNFT
as ticket. //cardinal
- Platform Owner
Hippo
want to make a subscription model. //cadinal
- Bot Developer
Iguana
want to build chatbot. //discord
,wasm
,cloudflare
- Data Analyst
Jaguar
want to read price data from oracle. //Dune
- Data Engineer
Kiwi
want to extract data from a contract. //Pyth
,explorer
,metaplex
- Data Scientist
Lion
want to build and deploy model. //tensorflow
,wasm
,PostgresML
- Game Developer //
bevy
,unreal
- Wasm Developer //
wasmer
,wasmtime
,solana-playground
- Setup:
vscode
,rust-analyzer
,cargo
, main/lib/workspace. - Hello World: crate, run, debug.
Basic main, focus on simple and straight forward. // Able to hello, condition, loop
- variable: str, slice,
string
,vec
,usize
, ref,mut
. - Structs
- #[derive(Copy, Clone, Debug, PartialEq)]
- method:
fn
,println
,json
,serde
, closures. - condition:
if
,match
,if let
, match guards. - Flow of Control:
while
,loop
,for
,range
,iter
,map
,filter
,collect
,rev
,chain
,inspect
,clone
,copied
. - find, rfind, find_map, collect.
- Vec: first, last, get, first_mut, last_mut, to_vec, len, is_empty, with_capacity, capacity, push, pop, insert, remove, resize, resize_with, truncate, clear, extend, split_off, append, drain, retain, dedup, dedup_by, dedup_by_key, concat, join, .
- conversions:
as
,as_str
,to_string
,From
,into
,try_into
,unwrap
/?
. - error: concept,
panic
,expect
,handling
,anyhow
(main). - test, assert!.
- Option, Result,
ok_or_else
.
Advance main, focus on complex, combine, compose // Able to create basic app + lib.
- variable:
OsString
,OsStr
,tuples
,bigint
, decimals,lazy_static
. - Generic Structs.
- #[repr(C)],
trait
,imp
. - method: derive, cast with
enum
,serde
,borsh
, - condition: match,
enum
,strum
. - Flow of Control:
enumerate
,into_iter
,filter_map
,flat_map
,flatten
. // Happy case - Iterator:
fold
,rfold
,try_fold
,try_rfold
,nth
,nth_back
,last
- Simple Accumulation: count, sum, product,max, min, max_by, min_by, max_by_key, min_by_key
- conversions:
to_owned
,as_ref
, down casting. - error: handling loop error,
thiserror
(lib). - doc test, cfg(test), allow, feature, package, version.
- read_line, write, write_all, flush, seek, stdin, stdout.
Basic lib, Serve cli, focus on app, use existing lib. // Able to create async app + advance lib
- HashSet, BTreeSet, LinkedList, HashMap, BTreeMap.
CStr
,CString
, lifetime,box
,dyn
,const
,regex
.take
,take_while
,skip
,skip_while
,peekable
,fuse
,zip
,by_ref
.- Iterator: eq, ne, lt, le, gt, any, all, position, rposition, and ExactSizeIterator.
- entry, or_insert, or_insert_with, and_modify.
- extends, partition, for_each and try_for_each.
- custom struct, module,
Value
,JsValue
,JsError
- Binding with @ Patterns,
- sync_std::task::block_on.
- async: fetch via
reqwest
,tokio
test. - error: custom error,
map_err
. // Failed case - cli
clap
,StructOpt
. - mvp
TODO-MVC
,yew
,trunk
. - wasm worker,
cloudflare
,vanilla-rpc
,agora-rpc
. - use-web-wasm:
wasm-bindgen
, viafirebase
. - connect db.
Advance lib, Serve API, Consume as web // Able to create lib, wasm
- rc, arc, refcall, heap, stack.
- thread::spawn, join, future,
spawn_local
,serde_wasm_bindgen
getter/setter,IntoWasmAbi
,FromWasmAbi
. - Subtraits, Type-Associated Functions, Traits That Define Relationships Between Types,
- Associated types, Generic Traits , impl Trait, Associated Consts.
- Structs with Lifetime Parameters.
- advance cargo, optimize, scope, target, workspace,
- build lib and use in mvp
API
actix. - use same lib as wasm in app.
- polymorphic: trait objects and generics, orphan rule.
- rust design pattern.
solana
: read account,pyth
- release, profile.
serde_wasm_bindgen
,gloo
,#[wasm_bindgen(getter_with_clone)]
Integrate with other, Security, Speed, Prod, CI/CD // Able to use advance lib, deploy.
Mutex
,Ref
,RefCell
,MutexGuard
,OnceCell
.VecDeque
,BinaryHeap
.- Cow.
- macro_rules.
Fn
,FnMut
,FnOnce
.- type state: https://yoric.github.io/post/rust-typestate/
- macro, expand.
- bench, optimize,
watt
. - extern.
solana
: read/writecounter
, cpi.anchor
: readtulip
,friktion
.tensorflow
.- deploy: docker,
cloud run
, multi-stage, build caching. - deploy: github page, github action.
wasm-rpc
, rpc blocking/non-blocking, vanilla, lite, playground.- OS-specific functionality.
#[cfg(target_os = "macos")]
- thread::spawn
- unsafe.
- foreign function interface (FFI)
- cargo bench, Continuous Benchmark
- 📚 A half-hour to
READ
Rust: https://fasterthanli.me/articles/a-half-hour-to-learn-rust - 🎮 Explore rust with playground: https://tourofrust.com/
- 📚 Easier to read compare with doc: https://dhghomon.github.io/easy_rust/Chapter_1.html
- 🎮 Fill in the blank quiz: https://github.com/sunface/rust-by-practice
- 🎮 Feel like fixing bugs: https://github.com/rust-lang/rustlings