Struct uninit_tools::buffer::BufferRef [−][src]
A reference to a Buffer, which is meant be a subset of the functionality offered by the
fully owned buffer.
For example, it neither allows reading from the unfilled region, nor swapping out the buffer pointed to, with anything else.
Implementations
impl<'buffer, T> BufferRef<'buffer, T>[src]
pub fn items_filled(&self) -> usize[src]
pub fn by_ref(&mut self) -> BufferRef<'_, T>[src]
Reborrow the inner buffer, getting a buffer reference with a shorter lifetime.
impl<'buffer, T> BufferRef<'buffer, T> where
T: Initialize, [src]
T: Initialize,
pub fn remaining(&self) -> usize[src]
pub fn unfilled_parts(
&mut self
) -> (&mut [T::Item], &mut [MaybeUninit<T::Item>])[src]
&mut self
) -> (&mut [T::Item], &mut [MaybeUninit<T::Item>])
pub unsafe fn unfilled_mut(&mut self) -> &mut [MaybeUninit<T::Item>]ⓘ[src]
Get a mutable and possibly-uninitialized reference to all of the buffer.
Safety
The caller must not allow safe code to de-initialize the resulting slice.
pub unsafe fn advance(&mut self, count: usize)[src]
Advance the counter of the number of items filled.
The number of items that are initialized is also updated accordingly, so that the number of items initialized is always greater than or equal to the number of items filled.
Safety
The caller must uphold the initialization invariant.
pub unsafe fn advance_all(&mut self)[src]
Advance the counter of the number of items filled, and the number of items initialized, to the end of the buffer.
Safety
The caller must uphold the initialization invariant.
pub fn revert_to_start(&mut self)[src]
pub fn fill_by_repeating(&mut self, item: T::Item) where
T::Item: Copy, [src]
T::Item: Copy,
pub fn append(&mut self, slice: &[T::Item]) where
T::Item: Copy, [src]
T::Item: Copy,
impl<T> BufferRef<'_, T> where
T: Initialize<Item = u8>, [src]
T: Initialize<Item = u8>,
pub fn fill_by_zeroing(&mut self)[src]
Auto Trait Implementations
impl<'buffer, T> RefUnwindSafe for BufferRef<'buffer, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'buffer, T> Send for BufferRef<'buffer, T> where
T: Send,
T: Send,
impl<'buffer, T> Sync for BufferRef<'buffer, T> where
T: Sync,
T: Sync,
impl<'buffer, T> Unpin for BufferRef<'buffer, T>
impl<'buffer, T> !UnwindSafe for BufferRef<'buffer, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,