Skip to content

gist-rs/learn-rust

Repository files navigation

learn-rs

🦀 Let's learn Rust together!

  1. Frontend Alice want to build web app. // main, todomvc, wasm, yew, github page
  2. Backend Bob want to build RESTful API for Alice. // lib, actix
  3. React Frontend Cat want to build wasm to use with ReactJS. // wasm, wasm-bindgen
  4. SmartContract Developer Dog want to build smart contract. // solana, anchor
  5. Artist Elephant want to create NFT. // metaplex, sugar
  6. Trainer Fox want to create ticket NFT. // cardinal
  7. Attendee Giraffe want to use rented NFT as ticket. // cardinal
  8. Platform Owner Hippo want to make a subscription model. // cadinal
  9. Bot Developer Iguana want to build chatbot. // discord, wasm, cloudflare
  10. Data Analyst Jaguar want to read price data from oracle. // Dune
  11. Data Engineer Kiwi want to extract data from a contract. // Pyth, explorer, metaplex
  12. Data Scientist Lion want to build and deploy model. // tensorflow, wasm, PostgresML
  13. Game Developer // bevy, unreal
  14. Wasm Developer // wasmer, wasmtime, solana-playground

Base

  1. Setup: vscode, rust-analyzer, cargo, main/lib/workspace.
  2. Hello World: crate, run, debug.

R5

Basic main, focus on simple and straight forward. // Able to hello, condition, loop

  1. variable: str, slice,string, vec, usize, ref, mut.
  2. Structs
  3. #[derive(Copy, Clone, Debug, PartialEq)]
  4. method: fn, println, json, serde, closures.
  5. condition: if, match, if let, match guards.
  6. Flow of Control: while, loop, for, range, iter, map, filter, collect, rev, chain, inspect, clone , copied.
  7. find, rfind, find_map, collect.
  8. 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, .
  9. conversions: as, as_str, to_string, From, into, try_into, unwrap/?.
  10. error: concept, panic, expect, handling, anyhow(main).
  11. test, assert!.
  12. Option, Result, ok_or_else.

R4

Advance main, focus on complex, combine, compose // Able to create basic app + lib.

  1. variable: OsString, OsStr, tuples, bigint, decimals, lazy_static.
  2. Generic Structs.
  3. #[repr(C)],trait, imp.
  4. method: derive, cast with enum, serde, borsh,
  5. condition: match, enum, strum.
  6. Flow of Control: enumerate, into_iter, filter_map, flat_map, flatten. // Happy case
  7. Iterator: fold,rfold,try_fold, try_rfold, nth, nth_back, last
  8. Simple Accumulation: count, sum, product,max, min, max_by, min_by, max_by_key, min_by_key
  9. conversions: to_owned, as_ref, down casting.
  10. error: handling loop error, thiserror(lib).
  11. doc test, cfg(test), allow, feature, package, version.
  12. read_line, write, write_all, flush, seek, stdin, stdout.

R3

Basic lib, Serve cli, focus on app, use existing lib. // Able to create async app + advance lib

  1. HashSet, BTreeSet, LinkedList, HashMap, BTreeMap.
  2. CStr, CString, lifetime, box, dyn, const, regex.
  3. take, take_while, skip, skip_while, peekable, fuse, zip, by_ref.
  4. Iterator: eq, ne, lt, le, gt, any, all, position, rposition, and ExactSizeIterator.
  5. entry, or_insert, or_insert_with, and_modify.
  6. extends, partition, for_each and try_for_each.
  7. custom struct, module, Value, JsValue, JsError
  8. Binding with @ Patterns,
  9. sync_std::task::block_on.
  10. async: fetch via reqwest, tokio test.
  11. error: custom error, map_err. // Failed case
  12. cli clap, StructOpt.
  13. mvp TODO-MVC, yew, trunk.
  14. wasm worker,cloudflare, vanilla-rpc, agora-rpc.
  15. use-web-wasm: wasm-bindgen, via firebase.
  16. connect db.

R2

Advance lib, Serve API, Consume as web // Able to create lib, wasm

  1. rc, arc, refcall, heap, stack.
  2. thread::spawn, join, future, spawn_local, serde_wasm_bindgen getter/setter, IntoWasmAbi, FromWasmAbi.
  3. Subtraits, Type-Associated Functions, Traits That Define Relationships Between Types,
  4. Associated types, Generic Traits , impl Trait, Associated Consts.
  5. Structs with Lifetime Parameters.
  6. advance cargo, optimize, scope, target, workspace,
  7. build lib and use in mvp API actix.
  8. use same lib as wasm in app.
  9. polymorphic: trait objects and generics, orphan rule.
  10. rust design pattern.
  11. solana: read account, pyth
  12. release, profile.
  13. serde_wasm_bindgen, gloo, #[wasm_bindgen(getter_with_clone)]

R1

Integrate with other, Security, Speed, Prod, CI/CD // Able to use advance lib, deploy.

  1. Mutex, Ref, RefCell, MutexGuard, OnceCell.
  2. VecDeque, BinaryHeap.
  3. Cow.
  4. macro_rules.
  5. Fn, FnMut, FnOnce.
  6. type state: https://yoric.github.io/post/rust-typestate/
  7. macro, expand.
  8. bench, optimize, watt.
  9. extern.
  10. solana: read/write counter, cpi.
  11. anchor: read tulip, friktion.
  12. tensorflow.
  13. deploy: docker, cloud run, multi-stage, build caching.
  14. deploy: github page, github action.
  15. wasm-rpc, rpc blocking/non-blocking, vanilla, lite, playground.
  16. OS-specific functionality. #[cfg(target_os = "macos")]
  17. thread::spawn
  18. unsafe.
  19. foreign function interface (FFI)
  20. cargo bench, Continuous Benchmark

Extras

  1. 📚 A half-hour to READ Rust: https://fasterthanli.me/articles/a-half-hour-to-learn-rust
  2. 🎮 Explore rust with playground: https://tourofrust.com/
  3. 📚 Easier to read compare with doc: https://dhghomon.github.io/easy_rust/Chapter_1.html
  4. 🎮 Fill in the blank quiz: https://github.com/sunface/rust-by-practice
  5. 🎮 Feel like fixing bugs: https://github.com/rust-lang/rustlings

About

🦀 Let's learn Rust together!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages