Skip to main content

encode_header

Function encode_header 

Source
pub fn encode_header(body_len: usize) -> String
Expand description

Encode a frame header for an outgoing message body of body_len bytes. Returns the ASCII header bytes including the trailing \r\n\r\n terminator – ready to be written before the body. Allocation-light: one String of bounded size.