pub struct FetchHeader {
pub request_id: VarInt,
}Expand description
Fetch stream header (draft-11, type 0x05).
Contains only the request_id. Objects follow inline.
Fields§
§request_id: VarIntRequest ID this fetch responds to.
Implementations§
Source§impl FetchHeader
impl FetchHeader
Sourcepub fn encode_stream(&self, buf: &mut impl BufMut)
pub fn encode_stream(&self, buf: &mut impl BufMut)
Encode a fetch stream header including its leading stream-type field, so the bytes form the start of a data stream a peer can read.
Self::encode writes the body alone, which is what a caller wants
once the stream is already open and what a caller must not use for its
first write. The read side has had Self::decode_stream all along,
so without this the codec could not round-trip its own fetch stream
through its own reader.
Sourcepub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
pub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
Decode a fetch header.
Sourcepub fn decode_stream(buf: &mut impl Buf) -> Result<Self, CodecError>
pub fn decode_stream(buf: &mut impl Buf) -> Result<Self, CodecError>
Decode a fetch header from the start of a data stream, consuming the leading stream type varint.
Errors with CodecError::UnknownStreamType when the stream table does
not assign the leading type, which this draft answers with a close, and
with CodecError::InvalidField when it is assigned but is not
StreamType::Fetch. stream_type_error draws that line.
Trait Implementations§
Source§impl Clone for FetchHeader
impl Clone for FetchHeader
Source§fn clone(&self) -> FetchHeader
fn clone(&self) -> FetchHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more