Skip to main content

split_request

Function split_request 

Source
pub fn split_request(payload: &[u8]) -> Result<(RequestId, &[u8]), NotARequest>
Expand description

Split a request frame’s payload (after the length prefix) into its ID and its body: the one parser of a request, for a node’s readers and for any program that reads requests off the wire (a proxy’s trace, a gateway’s codec). Anything but a TAG_REQUEST payload with room for the ID is NotARequest; the body may be empty.