pub struct GenericMutablePacket<'a, P: Packet> { /* private fields */ }Expand description
A generic mutable packet wrapper that validates using the immutable packet parser and exposes the raw buffer for in-place mutation.
Implementations§
Source§impl<'a, P: Packet> GenericMutablePacket<'a, P>
impl<'a, P: Packet> GenericMutablePacket<'a, P>
Sourcepub fn new_unchecked(buffer: &'a mut [u8]) -> Self
pub fn new_unchecked(buffer: &'a mut [u8]) -> Self
Construct a mutable packet without running additional validation.
Trait Implementations§
Source§impl<'a, P: Packet> MutablePacket<'a> for GenericMutablePacket<'a, P>
impl<'a, P: Packet> MutablePacket<'a> for GenericMutablePacket<'a, P>
Source§fn new(buffer: &'a mut [u8]) -> Option<Self>
fn new(buffer: &'a mut [u8]) -> Option<Self>
Construct a mutable packet from the provided buffer.
Source§fn packet_mut(&mut self) -> &mut [u8] ⓘ
fn packet_mut(&mut self) -> &mut [u8] ⓘ
Get a mutable view over the entire packet buffer.
Source§fn header_mut(&mut self) -> &mut [u8] ⓘ
fn header_mut(&mut self) -> &mut [u8] ⓘ
Get a mutable view over the serialized header bytes of the packet.
Source§fn payload_mut(&mut self) -> &mut [u8] ⓘ
fn payload_mut(&mut self) -> &mut [u8] ⓘ
Get a mutable view over the payload bytes of the packet.
Auto Trait Implementations§
impl<'a, P> Freeze for GenericMutablePacket<'a, P>
impl<'a, P> RefUnwindSafe for GenericMutablePacket<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for GenericMutablePacket<'a, P>where
P: Send,
impl<'a, P> Sync for GenericMutablePacket<'a, P>where
P: Sync,
impl<'a, P> Unpin for GenericMutablePacket<'a, P>where
P: Unpin,
impl<'a, P> !UnwindSafe for GenericMutablePacket<'a, P>
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