#[non_exhaustive]pub enum PacketPayload {
Owned(Vec<u8>),
Shared {
bytes: Arc<[u8]>,
start: usize,
len: usize,
},
Accounted(SharedStorage<u8>),
}Expand description
Where a packet’s bytes live.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Owned(Vec<u8>)
Bytes the packet owns.
len bytes of bytes starting at start.
Accounted(SharedStorage<u8>)
Admitted storage. Clones and subviews retain the backing allocation’s charge until its last owner drops.
Implementations§
Source§impl PacketPayload
impl PacketPayload
Trait Implementations§
Source§impl Clone for PacketPayload
impl Clone for PacketPayload
Source§fn clone(&self) -> PacketPayload
fn clone(&self) -> PacketPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PacketPayload
impl RefUnwindSafe for PacketPayload
impl Send for PacketPayload
impl Sync for PacketPayload
impl Unpin for PacketPayload
impl UnsafeUnpin for PacketPayload
impl UnwindSafe for PacketPayload
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