Buffers

Struct Buffers 

Source
pub struct Buffers<T> { /* private fields */ }

Implementations§

Source§

impl<T> Buffers<T>

Source

pub const fn from_initializer(initializer: BuffersInitializer<T>) -> Self

Source

pub const fn new(inner: T) -> Self

Source

pub const fn initializer(&self) -> &BuffersInitializer<T>

Source

pub fn initializer_mut(&mut self) -> &mut BuffersInitializer<T>

Source

pub fn into_initializer(self) -> BuffersInitializer<T>

Source

pub fn into_inner(self) -> T

Source

pub const fn vectors_filled(&self) -> usize

Source§

impl<T, Item> Buffers<T>
where T: InitializeVectored, T::UninitVector: Initialize<Item = Item>,

Source

pub fn all_previously_filled_vectors(&self) -> &[AssertInit<T::UninitVector>]

Source

pub fn all_previously_filled_vectors_mut( &mut self, ) -> &[AssertInit<T::UninitVector>]

Source

pub fn current_vector_all(&self) -> Option<&[MaybeUninit<Item>]>

Source

pub unsafe fn current_vector_all_mut( &mut self, ) -> Option<&mut [MaybeUninit<Item>]>

Get the entire current vector as a mutable possibly-uninitialized slice, or None if all vectors are already filled.

§Safety

The caller must not allow the returned slice to be de-initialized in safe code.

Source

pub fn current_vector_init_uninit_parts( &self, ) -> Option<(&[Item], &[MaybeUninit<Item>])>

Source

pub fn current_vector_init_uninit_parts_mut( &mut self, ) -> Option<(&mut [Item], &mut [MaybeUninit<Item>])>

Source

pub fn current_vector_filled_part(&self) -> Option<&[Item]>

Source

pub fn current_vector_filled_part_mut(&mut self) -> Option<&mut [Item]>

Source

pub fn current_vector_unfilled_all_part(&self) -> Option<&[MaybeUninit<Item>]>

Source

pub unsafe fn current_vector_unfilled_all_part_mut( &mut self, ) -> Option<&mut [MaybeUninit<Item>]>

Retrieve all of the unfilled part as a single possibly-uninitialized mutable reference.

§Safety

Since the returned slice could contain both the unfilled but initialized, and the unfilled and uninitialized, this allows it to overlap. Thus, the caller must not de-initialize the resulting slice in any way, in safe code.

Source

pub fn all_next_unfilled_vectors(&self) -> &[T::UninitVector]

Source

pub fn all_next_unfilled_vectors_mut(&mut self) -> &mut [T::UninitVector]

Source

pub fn all_filled_vectors(&self) -> (&[AssertInit<T::UninitVector>], &[Item])

Return all vectors that have been fully filled, sequentially, as well as the filled part of the current vector in progress.

Source

pub fn current_vector_parts(&self) -> Option<VectorParts<'_, Item>>

For the current vector, return the unfilled and initialized part, the unfilled but initialized part, and the unfilled and uninitialized part, in that order.

Note that unlike current_vector_all_mut, the exclusive aliasing rules that come with mutable references are not needed here. The same result as calling this can be achieved by calling the finer-grained methods that access the individual parts of the current vector.

Source

pub fn current_vector_parts_mut(&mut self) -> Option<VectorPartsMut<'_, Item>>

For the current vector, return the unfilled and initialized part, the unfilled but initialized part, and the unfilled and uninitialized part mutably, in that order.

Source

pub fn total_vector_count(&self) -> usize

Source

pub fn vectors_remaining(&self) -> usize

Source

pub fn count_remaining_items_to_fill(&self) -> usize

Source

pub fn count_total_items_in_all_vectors(&self) -> usize

Source

pub fn remaining_for_current_vector(&self) -> usize

Get the number of items that remain before the current vector becomes fully filled.

If there is no current vector, which is the condition when all vectors have been filled, then this returns zero.

Source

pub fn advance_current_vector(&mut self, count: usize)

Advance the current vector by count items.

§Panics

This will panic if the initialized part of the current vector is exceeded. When calling this in FFI contexts, you must call the advance functions in the initializer before calling this.

Source

pub fn advance_to_current_vector_end(&mut self)

Source§

impl<T> Buffers<T>

Source§

impl<T> Buffers<SingleVector<T>>
where T: Initialize,

Source

pub fn from_single_buffer(buffer: Buffer<T>) -> Self

Source§

impl<T> Buffers<T>

Source

pub fn by_ref(&mut self) -> BuffersRef<'_, T>

Auto Trait Implementations§

§

impl<T> Freeze for Buffers<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Buffers<T>
where T: RefUnwindSafe,

§

impl<T> Send for Buffers<T>
where T: Send,

§

impl<T> Sync for Buffers<T>
where T: Sync,

§

impl<T> Unpin for Buffers<T>
where T: Unpin,

§

impl<T> UnwindSafe for Buffers<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.