Slug: wasm-parse-01 · Paired reading: Chapter 25
Prompt
struct Header<'a> { name: &'a str, payload: &'a [u8] } parsed from
length-prefixed bytes: first byte = name length, then name UTF-8 bytes,
then payload. Borrows from the input — no copies.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
advanced · order 161
Slug: wasm-parse-01 · Paired reading: Chapter 25
struct Header<'a> { name: &'a str, payload: &'a [u8] } parsed from
length-prefixed bytes: first byte = name length, then name UTF-8 bytes,
then payload. Borrows from the input — no copies.