Skip to main content

encode_request_body

Function encode_request_body 

Source
pub fn encode_request_body(message: &[u8]) -> Bytes
Expand description

Encode a +proto unary request body: a single [u32 len | message] block, mirroring the response’s message block. The client prepends the length it already knows (protobuf is serialized whole), so the server/proxy can turn it into a gRPC frame — [1-byte flag] + this — and stream it upstream without buffering to measure.