pub struct PacketBatch { /* private fields */ }
Implementations§
Source§impl PacketBatch
impl PacketBatch
pub fn new(packets: Vec<Packet>) -> PacketBatch
pub fn with_capacity(capacity: usize) -> PacketBatch
pub fn new_pinned_with_capacity(capacity: usize) -> PacketBatch
pub fn new_unpinned_with_recycler( recycler: &Recycler<PinnedVec<Packet>>, capacity: usize, name: &'static str, ) -> PacketBatch
pub fn new_with_recycler( recycler: &Recycler<PinnedVec<Packet>>, capacity: usize, name: &'static str, ) -> PacketBatch
pub fn new_with_recycler_data( recycler: &Recycler<PinnedVec<Packet>>, name: &'static str, packets: Vec<Packet>, ) -> PacketBatch
pub fn new_unpinned_with_recycler_data_and_dests<T>(
recycler: &Recycler<PinnedVec<Packet>>,
name: &'static str,
dests_and_data: &[(SocketAddr, T)],
) -> PacketBatchwhere
T: Serialize,
pub fn new_unpinned_with_recycler_data( recycler: &Recycler<PinnedVec<Packet>>, name: &'static str, packets: Vec<Packet>, ) -> PacketBatch
pub fn resize(&mut self, new_len: usize, value: Packet)
pub fn truncate(&mut self, len: usize)
pub fn push(&mut self, packet: Packet)
pub fn set_addr(&mut self, addr: &SocketAddr)
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_ptr(&self) -> *const Packet
pub fn iter(&self) -> Iter<'_, Packet>
pub fn iter_mut(&mut self) -> IterMut<'_, Packet>
Sourcepub unsafe fn set_len(&mut self, new_len: usize)
pub unsafe fn set_len(&mut self, new_len: usize)
See Vector::set_len() for more details
§Safety
new_len
must be less than or equal to [self.capacity
].- The elements at
old_len..new_len
must be initialized. Packet data will likely be overwritten when populating the packet, but the meta should specifically be initialized to known values.
Trait Implementations§
Source§impl Clone for PacketBatch
impl Clone for PacketBatch
Source§fn clone(&self) -> PacketBatch
fn clone(&self) -> PacketBatch
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PacketBatch
impl Debug for PacketBatch
Source§impl Default for PacketBatch
impl Default for PacketBatch
Source§fn default() -> PacketBatch
fn default() -> PacketBatch
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PacketBatch
impl<'de> Deserialize<'de> for PacketBatch
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PacketBatch, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PacketBatch, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<I> Index<I> for PacketBatchwhere
I: SliceIndex<[Packet]>,
impl<I> Index<I> for PacketBatchwhere
I: SliceIndex<[Packet]>,
Source§impl<I> IndexMut<I> for PacketBatchwhere
I: SliceIndex<[Packet]>,
impl<I> IndexMut<I> for PacketBatchwhere
I: SliceIndex<[Packet]>,
Source§impl<'a> IntoIterator for &'a PacketBatch
impl<'a> IntoIterator for &'a PacketBatch
Source§impl<'a> IntoParallelIterator for &'a PacketBatch
impl<'a> IntoParallelIterator for &'a PacketBatch
Source§impl<'a> IntoParallelIterator for &'a mut PacketBatch
impl<'a> IntoParallelIterator for &'a mut PacketBatch
Source§fn into_par_iter(self) -> <&'a mut PacketBatch as IntoParallelIterator>::Iter
fn into_par_iter(self) -> <&'a mut PacketBatch as IntoParallelIterator>::Iter
Converts
self
into a parallel iterator. Read moreSource§impl Serialize for PacketBatch
impl Serialize for PacketBatch
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PacketBatch
impl RefUnwindSafe for PacketBatch
impl Send for PacketBatch
impl Sync for PacketBatch
impl Unpin for PacketBatch
impl UnwindSafe for PacketBatch
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<'data, I> IntoParallelRefIterator<'data> for I
impl<'data, I> IntoParallelRefIterator<'data> for I
Source§impl<'data, I> IntoParallelRefMutIterator<'data> for I
impl<'data, I> IntoParallelRefMutIterator<'data> for I
Source§type Iter = <&'data mut I as IntoParallelIterator>::Iter
type Iter = <&'data mut I as IntoParallelIterator>::Iter
The type of iterator that will be created.
Source§type Item = <&'data mut I as IntoParallelIterator>::Item
type Item = <&'data mut I as IntoParallelIterator>::Item
The type of item that will be produced; this is typically an
&'data mut T
reference.Source§fn par_iter_mut(
&'data mut self,
) -> <I as IntoParallelRefMutIterator<'data>>::Iter
fn par_iter_mut( &'data mut self, ) -> <I as IntoParallelRefMutIterator<'data>>::Iter
Creates the parallel iterator from
self
. Read more