Function gstuff::netstring

source ·
pub fn netstring(at: &[u8]) -> Result<(&[u8], &[u8]), String>
Expand description

Takes a netstring from the front of the slice.

Returns the unpacked netstring and the remainder of the slice.

NB: Netstring encoding is not included as a separate function because it is as simple as write! (&mut buf, "{}:{},", payload.len(), payload);.