pub struct MessagePacket<'a> { /* private fields */ }Expand description
A packet containing a message and its header.
Implementations§
Source§impl<'a> MessagePacket<'a>
impl<'a> MessagePacket<'a>
Sourcepub unsafe fn new(data: NonNull<MessageHeader>, len: usize) -> Self
pub unsafe fn new(data: NonNull<MessageHeader>, len: usize) -> Self
Creates a new message packet.
Sourcepub unsafe fn allocate(
allocator: &'a dyn Allocator,
extra_capacity: usize,
) -> Result<Self, AllocError>
pub unsafe fn allocate( allocator: &'a dyn Allocator, extra_capacity: usize, ) -> Result<Self, AllocError>
Allocates a new message packet with the given extra capacity.
Sourcepub fn header(&self) -> &'a MessageHeader
pub fn header(&self) -> &'a MessageHeader
Returns the message header.
Sourcepub fn header_mut(&self) -> &'a mut MessageHeader
pub fn header_mut(&self) -> &'a mut MessageHeader
Returns a mutable reference to the message header.
Auto Trait Implementations§
impl<'a> Freeze for MessagePacket<'a>
impl<'a> RefUnwindSafe for MessagePacket<'a>
impl<'a> !Send for MessagePacket<'a>
impl<'a> !Sync for MessagePacket<'a>
impl<'a> Unpin for MessagePacket<'a>
impl<'a> UnwindSafe for MessagePacket<'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