I'm trying to write a zero-copy parser for a binary file format in Rust. I've read the entire file into a
Vec<u8> and I'm looking for a function that takes in a usize or something and returns a slice of the
Vec with those number of bytes. Sort of like
read_exact() but instead of filling up a buffer it returns a slice. Is there any such function in the standard library?