~/talk

Destructuring Rust strings

Talkat BlaBlaConf 2022 · 2022-12-19..12-23· [rust]
links:none on file
slides:none on file

Covers concrete Rust types and conversion patterns: String = heap allocated, mutable, UTF‑8 and &str = borrowed, immutable slice, shows Cow\<str\> used to avoid allocations by returning a borrow unless filtering forces an owned string, and demonstrates CString/CStr for null‑terminated FFI with examples calling into C via raw pointers and unsafe from_raw conversions. Explains OsStr/OsString for platform bytes and why indexing fails on UTF‑8, and gives the practical tradeoffs and when allocation actually happens.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04Rust string types overview
  3. 2:25Prerequisites and setup
  4. 2:46String type in Rust
  5. 5:40Str type and references
  6. 8:10Cow type explained
  7. 12:27OS string and C string
  8. 15:47FFI and unsafe operations
  9. 16:43Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.