Trait fire_stream_api::message::PacketBytes
source · pub trait PacketBytes: Debug {
// Required methods
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§
sourcefn new(header_len: usize) -> Self
fn new(header_len: usize) -> Self
Creates a new Bytes instance.
It must always have header len available and initialized
sourcefn header_mut(&mut self) -> BytesMut<'_>
fn header_mut(&mut self) -> BytesMut<'_>
Returns the header mutably.
sourcefn full_header_mut(&mut self) -> BytesMut<'_>
fn full_header_mut(&mut self) -> BytesMut<'_>
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
.
sourcefn body_mut(&mut self) -> BodyBytesMut<'_>
fn body_mut(&mut self) -> BodyBytesMut<'_>
Returns the body mutably.
sourcefn full_body_mut(&mut self) -> BytesMut<'_>
fn full_body_mut(&mut self) -> BytesMut<'_>
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
.
Object Safety§
This trait is not object safe.