pub trait PacketBytes: Debug {
    fn new(header_len: usize) -> Self;
    fn header(&self) -> Bytes<'_>;
    fn header_mut(&mut self) -> BytesMut<'_>;
    fn full_header_mut(&mut self) -> BytesMut<'_>;
    fn body(&self) -> BodyBytes<'_>;
    fn body_mut(&mut self) -> BodyBytesMut<'_>;
    fn full_body_mut(&mut self) -> BytesMut<'_>;
}
Expand description

A trait that allows efficient allocation if encryption is used or not.

Required Methods§

Creates a new Bytes instance.

It must always have header len available and initialized

Returns the header Bytes.

Returns the header mutably.

Returns the full header mutably.

Note

This should only be used to fill the buffer from a reader, in any other case you should use header_mut.

Returns the body.

Returns the body mutably.

Returns the full body mutably.

Note

This should only be used to fill the buffer from a reader, in any other case you should use body_mut.

Implementors§