Function httparse::parse_chunk_size [−][src]
pub fn parse_chunk_size(
buf: &[u8]
) -> Result<Status<(usize, u64)>, InvalidChunkSize>
Parse a buffer of bytes as a chunk size.
The return value, if complete and successful, includes the index of the buffer that parsing stopped at, and the size of the following chunk.
Example
let buf = b"4\r\nRust\r\n0\r\n\r\n"; assert_eq!(httparse::parse_chunk_size(buf), Ok(httparse::Status::Complete((3, 4))));