Struct uninit_tools::buffer::BufferRef [−][src]
pub struct BufferRef<'buffer, T> { /* fields omitted */ }
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> where
T: Initialize,
[src]
impl<'buffer, T> BufferRef<'buffer, T> where
T: Initialize,
[src]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]
impl<T> BufferRef<'_, T> where
T: Initialize<Item = u8>,
[src]pub fn fill_by_zeroing(&mut self)
[src]
Auto Trait Implementations
impl<'buffer, T> RefUnwindSafe for BufferRef<'buffer, T> where
T: RefUnwindSafe,
impl<'buffer, T> RefUnwindSafe for BufferRef<'buffer, T> where
T: RefUnwindSafe,
impl<'buffer, T> !UnwindSafe for BufferRef<'buffer, T>
impl<'buffer, T> !UnwindSafe for BufferRef<'buffer, T>