I'm looking to send a specific number of bytes (e.g. 1GB) as a non-chunked response in a hyper server I'm making. I'm new to Rust and figured I could just the Rust equivalent of byte slice but that hasn't been working. Wondering what is the best way to accomplish this.
let mut bytes = BytesMut::with_capacity(64).freeze();
Ok(Response::new(Body::from(bytes)))
This returns a response with 0 content length but I want it to return 64 bytes.