IntermediateBufferArray

Struct IntermediateBufferArray 

Source
pub struct IntermediateBufferArray<'a, const N: usize> {
    pub array: [Option<&'a IntermediateBuffer>; N],
    pub initialized_count: usize,
}
Expand description

IntermediateBufferArray is a struct that holds an array of references to IntermediateBuffer objects. It also keeps track of the number of initialized elements in the array.

Fields§

§array: [Option<&'a IntermediateBuffer>; N]§initialized_count: usize

Implementations§

Source§

impl<'a, const N: usize> IntermediateBufferArray<'a, N>

Source

pub fn new(iter: impl Iterator<Item = &'a IntermediateBuffer>) -> Self

Constructs a new IntermediateBufferArray from an iterator over references to IntermediateBuffer objects. The iterator is consumed up to N items and the number of initialized elements is tracked.

Source

pub fn get_packet_number(&self) -> usize

Returns the number of initialized elements in the array.

Trait Implementations§

Source§

impl<'a, const N: usize> Default for IntermediateBufferArray<'a, N>

Provides a default value for IntermediateBufferArray. The default value is an array of None with a size of N and an initialized count of 0.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, const N: usize> Extend<&'a IntermediateBuffer> for IntermediateBufferArray<'a, N>

Extends the IntermediateBufferArray with an iterator over references to IntermediateBuffer objects. The iterator is consumed up to N items and the number of initialized elements is tracked.

Source§

fn extend<T: IntoIterator<Item = &'a IntermediateBuffer>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a, const N: usize> From<IntermediateBufferArray<'a, N>> for [Option<&'a IntermediateBuffer>; N]

Converts the IntermediateBufferArray into an array of mutable references to IntermediateBuffer objects.

Source§

fn from(val: IntermediateBufferArray<'a, N>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, const N: usize> Freeze for IntermediateBufferArray<'a, N>

§

impl<'a, const N: usize> RefUnwindSafe for IntermediateBufferArray<'a, N>

§

impl<'a, const N: usize> Send for IntermediateBufferArray<'a, N>

§

impl<'a, const N: usize> Sync for IntermediateBufferArray<'a, N>

§

impl<'a, const N: usize> Unpin for IntermediateBufferArray<'a, N>

§

impl<'a, const N: usize> UnwindSafe for IntermediateBufferArray<'a, N>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.