pub struct CopyEvent<'a>(/* private fields */);Expand description
A packet event captured with crate::rules::Action::Copy. This will block the ring buffer
until it is dropped, so it should be consumed quickly. Calling
CopyEvent::into_owned returns an OwnedCopyEvent, dropping the underlying RingBufItem
at the cost of a copy.
Implementations§
Source§impl CopyEvent<'_>
impl CopyEvent<'_>
Sourcepub fn take(&self) -> Option<u32>
pub fn take(&self) -> Option<u32>
If set, returns the number of bytes copied. This may be lower than the originally specified value, if the packet is less than the original take.
Sourcepub fn packet_len(&self) -> u32
pub fn packet_len(&self) -> u32
Returns the length of the packet data, before take is applied
Sourcepub fn into_owned(self) -> OwnedCopyEvent
pub fn into_owned(self) -> OwnedCopyEvent
Converts to an OwnedCopyEvent, dropping the underlying RingBufItem which frees
capacity for successive writes.
Trait Implementations§
Source§impl<'a> From<RingBufItem<'a>> for CopyEvent<'a>
impl<'a> From<RingBufItem<'a>> for CopyEvent<'a>
Source§fn from(value: RingBufItem<'a>) -> Self
fn from(value: RingBufItem<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for CopyEvent<'a>
impl<'a> RefUnwindSafe for CopyEvent<'a>
impl<'a> Send for CopyEvent<'a>
impl<'a> Sync for CopyEvent<'a>
impl<'a> Unpin for CopyEvent<'a>
impl<'a> UnsafeUnpin for CopyEvent<'a>
impl<'a> !UnwindSafe for CopyEvent<'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