Trait fire_stream::packet::PacketHeader
source · pub trait PacketHeader: Debug + Sized {
fn len() -> usize;
fn from_bytes(bytes: Bytes<'_>) -> Result<Self>;
fn body_len(&self) -> usize;
fn flags(&self) -> &Flags;
fn set_flags(&mut self, flags: Flags);
fn id(&self) -> u32;
fn set_id(&mut self, id: u32);
}Required Methods§
fn len() -> usize
sourcefn from_bytes(bytes: Bytes<'_>) -> Result<Self>
fn from_bytes(bytes: Bytes<'_>) -> Result<Self>
bytes.len() == Self::len()
fn flags(&self) -> &Flags
fn set_flags(&mut self, flags: Flags)
sourcefn id(&self) -> u32
fn id(&self) -> u32
Returns the internal flags.
Note
This is returned as a number so that outside of this crate nobody can rely on the information contained within.