My personal Rust notes.
Rust Notes
Learning Resources
- Quick guide for system programmer
- Official books
Personal Notes
- Common
- Understand borrowing by read-write concepts
- Lifetime
- Rust Strings
- How to convert a C strings to Rust strings
- Phantom data
- Common Error
- Don’t misuse the pointers of the instances allocated in functions stack
- Temporary cstring as ptr
- Will get a
temporary_cstring_as_ptr
error when runningcargo clippy
- However, it’s ok in some case
- playground example: Check the IR
- temporary-lifetimes
- Will get a
- Panic while panicking
- Polymorphism
- Multi-threading
- Async
- FFI to C library
- A sample Rust library based on platform C APIs
- Opaque or Transparent Data Type
- Pass arrays from Rust to C
- The size matters! How to mess up memory by using vector in a wrong way
- A counterexample to use the memory allocated in external library
- Using reference /pointer instead of copying to get a variable-sized struct object
- Using single-element (tuple) struct to wrap native types
- How to wrap a callback from external library
- C, C++, Rust Examples to call C Query APIs
- OSX
- Single-element tuple structs wrapping native CoreAudio types
- Rust wrappers for OSX dispatch APIs
- Rust wrappers for OSX property listner on audio devices
- Rust wrappers for OSX CFString(Ref) APIs
- Taste
- Error Handling
- Testing
- Embeding a test module inside every module
- Idioms/Patterns