Enum pnet::packet::MutPacketData
pub enum MutPacketData<'p> {
Owned(Vec<u8, Global>),
Borrowed(&'p mut [u8]),
}
Expand description
Mutable packet data.
Variants§
Owned(Vec<u8, Global>)
Owned mutable packet data.
Borrowed(&'p mut [u8])
Borrowed mutable packet data.
Implementations§
§impl<'p> MutPacketData<'p>
impl<'p> MutPacketData<'p>
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Get packet data as a mutable slice.
pub fn to_immutable(self) -> PacketData<'p>
pub fn to_immutable(self) -> PacketData<'p>
Get an immutable version of packet data.
Trait Implementations§
§impl<'p> Index<Range<usize>> for MutPacketData<'p>
impl<'p> Index<Range<usize>> for MutPacketData<'p>
§impl<'p> Index<RangeFrom<usize>> for MutPacketData<'p>
impl<'p> Index<RangeFrom<usize>> for MutPacketData<'p>
§impl<'p> Index<RangeFull> for MutPacketData<'p>
impl<'p> Index<RangeFull> for MutPacketData<'p>
§impl<'p> Index<RangeTo<usize>> for MutPacketData<'p>
impl<'p> Index<RangeTo<usize>> for MutPacketData<'p>
§impl<'p> Index<usize> for MutPacketData<'p>
impl<'p> Index<usize> for MutPacketData<'p>
§impl<'p> IndexMut<Range<usize>> for MutPacketData<'p>
impl<'p> IndexMut<Range<usize>> for MutPacketData<'p>
§impl<'p> IndexMut<RangeFrom<usize>> for MutPacketData<'p>
impl<'p> IndexMut<RangeFrom<usize>> for MutPacketData<'p>
§impl<'p> IndexMut<RangeFull> for MutPacketData<'p>
impl<'p> IndexMut<RangeFull> for MutPacketData<'p>
§impl<'p> IndexMut<RangeTo<usize>> for MutPacketData<'p>
impl<'p> IndexMut<RangeTo<usize>> for MutPacketData<'p>
§impl<'p> IndexMut<usize> for MutPacketData<'p>
impl<'p> IndexMut<usize> for MutPacketData<'p>
§impl<'p> PartialEq<MutPacketData<'p>> for MutPacketData<'p>
impl<'p> PartialEq<MutPacketData<'p>> for MutPacketData<'p>
§fn eq(&self, other: &MutPacketData<'p>) -> bool
fn eq(&self, other: &MutPacketData<'p>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'p> StructuralPartialEq for MutPacketData<'p>
Auto Trait Implementations§
impl<'p> RefUnwindSafe for MutPacketData<'p>
impl<'p> Send for MutPacketData<'p>
impl<'p> Sync for MutPacketData<'p>
impl<'p> Unpin for MutPacketData<'p>
impl<'p> !UnwindSafe for MutPacketData<'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