Enum pnet::packet::PacketData
pub enum PacketData<'p> {
Owned(Vec<u8, Global>),
Borrowed(&'p [u8]),
}
Expand description
Packet data.
Variants§
Owned(Vec<u8, Global>)
A packet owns its contents.
Borrowed(&'p [u8])
A packet borrows its contents.
Implementations§
§impl<'p> PacketData<'p>
impl<'p> PacketData<'p>
pub fn to_immutable(self) -> PacketData<'p>
pub fn to_immutable(self) -> PacketData<'p>
No-op - returns self
.
Trait Implementations§
§impl<'p> Index<Range<usize>> for PacketData<'p>
impl<'p> Index<Range<usize>> for PacketData<'p>
§impl<'p> Index<RangeFrom<usize>> for PacketData<'p>
impl<'p> Index<RangeFrom<usize>> for PacketData<'p>
§impl<'p> Index<RangeFull> for PacketData<'p>
impl<'p> Index<RangeFull> for PacketData<'p>
§impl<'p> Index<RangeTo<usize>> for PacketData<'p>
impl<'p> Index<RangeTo<usize>> for PacketData<'p>
§impl<'p> Index<usize> for PacketData<'p>
impl<'p> Index<usize> for PacketData<'p>
§impl<'p> PartialEq<PacketData<'p>> for PacketData<'p>
impl<'p> PartialEq<PacketData<'p>> for PacketData<'p>
§fn eq(&self, other: &PacketData<'p>) -> bool
fn eq(&self, other: &PacketData<'p>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'p> StructuralPartialEq for PacketData<'p>
Auto Trait Implementations§
impl<'p> RefUnwindSafe for PacketData<'p>
impl<'p> Send for PacketData<'p>
impl<'p> Sync for PacketData<'p>
impl<'p> Unpin for PacketData<'p>
impl<'p> UnwindSafe for PacketData<'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