pub(crate) struct ArrayBuffer<const N: usize> {
data: [MaybeUninit<u8>; N],
}Expand description
An uninitialized slice of bytes of fixed size.
This is typically used with BorrowedBuffer.
Fields§
§data: [MaybeUninit<u8>; N]Implementations§
Source§impl<const N: usize> ArrayBuffer<N>
impl<const N: usize> ArrayBuffer<N>
Sourcepub(crate) fn as_borrowed<'data>(&mut self) -> BorrowedBuffer<'_>
pub(crate) fn as_borrowed<'data>(&mut self) -> BorrowedBuffer<'_>
Return a writable buffer into this storage.
Sourceunsafe fn assume_init(self) -> [u8; N]
unsafe fn assume_init(self) -> [u8; N]
Assume this entire buffer is initialized and return it as an array.
§Safety
Callers must ensure the entire buffer is initialized.
Trait Implementations§
Source§impl<const N: usize> Clone for ArrayBuffer<N>
impl<const N: usize> Clone for ArrayBuffer<N>
Source§fn clone(&self) -> ArrayBuffer<N>
fn clone(&self) -> ArrayBuffer<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Default for ArrayBuffer<N>
Construct an uninitialized buffer of data of size N.
impl<const N: usize> Default for ArrayBuffer<N>
Construct an uninitialized buffer of data of size N.
Source§fn default() -> ArrayBuffer<N>
fn default() -> ArrayBuffer<N>
Returns the “default value” for a type. Read more
impl<const N: usize> Copy for ArrayBuffer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for ArrayBuffer<N>
impl<const N: usize> RefUnwindSafe for ArrayBuffer<N>
impl<const N: usize> Send for ArrayBuffer<N>
impl<const N: usize> Sync for ArrayBuffer<N>
impl<const N: usize> Unpin for ArrayBuffer<N>
impl<const N: usize> UnwindSafe for ArrayBuffer<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more