Struct solana_perf::packet::PacketBatch
source · [−]pub struct PacketBatch { /* private fields */ }
Implementations
sourceimpl PacketBatch
impl PacketBatch
pub fn new(packets: Vec<Packet>) -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn new_pinned_with_capacity(capacity: usize) -> Self
pub fn new_unpinned_with_recycler(
recycler: PacketBatchRecycler,
capacity: usize,
name: &'static str
) -> Self
pub fn new_with_recycler(
recycler: PacketBatchRecycler,
capacity: usize,
name: &'static str
) -> Self
pub fn new_with_recycler_data(
recycler: &PacketBatchRecycler,
name: &'static str,
packets: Vec<Packet>
) -> Self
pub fn new_unpinned_with_recycler_data(
recycler: &PacketBatchRecycler,
name: &'static str,
packets: Vec<Packet>
) -> Self
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 [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
sourceimpl Clone for PacketBatch
impl Clone for PacketBatch
sourcefn clone(&self) -> PacketBatch
fn clone(&self) -> PacketBatch
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PacketBatch
impl Debug for PacketBatch
sourceimpl Default for PacketBatch
impl Default for PacketBatch
sourcefn default() -> PacketBatch
fn default() -> PacketBatch
Returns the “default value” for a type. Read more
sourceimpl From<PacketBatch> for Vec<Packet>
impl From<PacketBatch> for Vec<Packet>
sourcefn from(batch: PacketBatch) -> Self
fn from(batch: PacketBatch) -> Self
Converts to this type from the input type.
sourceimpl<I: SliceIndex<[Packet]>> Index<I> for PacketBatch
impl<I: SliceIndex<[Packet]>> Index<I> for PacketBatch
sourceimpl<I: SliceIndex<[Packet]>> IndexMut<I> for PacketBatch
impl<I: SliceIndex<[Packet]>> IndexMut<I> for PacketBatch
sourceimpl<'a> IntoIterator for &'a PacketBatch
impl<'a> IntoIterator for &'a PacketBatch
sourceimpl<'a> IntoParallelIterator for &'a PacketBatch
impl<'a> IntoParallelIterator for &'a PacketBatch
sourceimpl<'a> IntoParallelIterator for &'a mut PacketBatch
impl<'a> IntoParallelIterator for &'a mut PacketBatch
Auto Trait Implementations
impl RefUnwindSafe for PacketBatch
impl Send for PacketBatch
impl Sync for PacketBatch
impl Unpin for PacketBatch
impl UnwindSafe for PacketBatch
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
impl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
type Iter = <&'data I as IntoParallelIterator>::Iter
type Iter = <&'data I as IntoParallelIterator>::Iter
The type of the parallel iterator that will be returned.
type Item = <&'data I as IntoParallelIterator>::Item
type Item = <&'data I as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
This will typically be an &'data T
reference type. Read more
sourcefn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
fn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
Converts self
into a parallel iterator. Read more
sourceimpl<'data, I> IntoParallelRefMutIterator<'data> for I where
I: 'data + ?Sized,
&'data mut I: IntoParallelIterator,
impl<'data, I> IntoParallelRefMutIterator<'data> for I where
I: 'data + ?Sized,
&'data mut I: IntoParallelIterator,
type Iter = <&'data mut I as IntoParallelIterator>::Iter
type Iter = <&'data mut I as IntoParallelIterator>::Iter
The type of iterator that will be created.
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. Read more
sourcefn 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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more