pub struct Frame<'a> {
pub message_type: u16,
pub payload: &'a [u8],
}Expand description
One complete TCP frame borrowed from an input buffer.
Frame::message_type is the raw wire code; use TcpMessageType::try_from
to resolve it to a known message. Frame::total_len is the number of bytes
the caller should consume from the front of the buffer before parsing again.
Fields§
§message_type: u16§payload: &'a [u8]Implementations§
Trait Implementations§
impl<'a> Copy for Frame<'a>
impl<'a> Eq for Frame<'a>
impl<'a> StructuralPartialEq for Frame<'a>
Auto Trait Implementations§
impl<'a> Freeze for Frame<'a>
impl<'a> RefUnwindSafe for Frame<'a>
impl<'a> Send for Frame<'a>
impl<'a> Sync for Frame<'a>
impl<'a> Unpin for Frame<'a>
impl<'a> UnwindSafe for Frame<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more