pub struct FixedBuffer<T, const SIZE: usize> { /* private fields */ }Expand description
Fixed-size buffer on the stack — default per-port buffer.
Implementations§
Source§impl<T: Copy + Default, const SIZE: usize> FixedBuffer<T, SIZE>
impl<T: Copy + Default, const SIZE: usize> FixedBuffer<T, SIZE>
Sourcepub fn from_array(data: [T; SIZE]) -> Self
pub fn from_array(data: [T; SIZE]) -> Self
Create a buffer from a fixed-size array.
Sourcepub fn from_slice(slice: &[T]) -> Selfwhere
T: Copy,
pub fn from_slice(slice: &[T]) -> Selfwhere
T: Copy,
Create a buffer from a slice, truncating or padding with T::default() as needed.
Sourcepub fn as_mut_array(&mut self) -> &mut [T; SIZE]
pub fn as_mut_array(&mut self) -> &mut [T; SIZE]
Return a mutable reference to the inner array.
Trait Implementations§
Source§impl<T: Default + Copy, const SIZE: usize> Buffer<T> for FixedBuffer<T, SIZE>
impl<T: Default + Copy, const SIZE: usize> Buffer<T> for FixedBuffer<T, SIZE>
Source§impl<T: Clone, const SIZE: usize> Clone for FixedBuffer<T, SIZE>
impl<T: Clone, const SIZE: usize> Clone for FixedBuffer<T, SIZE>
Source§fn clone(&self) -> FixedBuffer<T, SIZE>
fn clone(&self) -> FixedBuffer<T, SIZE>
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<T, const SIZE: usize> Deref for FixedBuffer<T, SIZE>
impl<T, const SIZE: usize> Deref for FixedBuffer<T, SIZE>
Source§impl<T, const SIZE: usize> DerefMut for FixedBuffer<T, SIZE>
impl<T, const SIZE: usize> DerefMut for FixedBuffer<T, SIZE>
Auto Trait Implementations§
impl<T, const SIZE: usize> Freeze for FixedBuffer<T, SIZE>where
T: Freeze,
impl<T, const SIZE: usize> RefUnwindSafe for FixedBuffer<T, SIZE>where
T: RefUnwindSafe,
impl<T, const SIZE: usize> Send for FixedBuffer<T, SIZE>where
T: Send,
impl<T, const SIZE: usize> Sync for FixedBuffer<T, SIZE>where
T: Sync,
impl<T, const SIZE: usize> Unpin for FixedBuffer<T, SIZE>where
T: Unpin,
impl<T, const SIZE: usize> UnsafeUnpin for FixedBuffer<T, SIZE>where
T: UnsafeUnpin,
impl<T, const SIZE: usize> UnwindSafe for FixedBuffer<T, SIZE>where
T: UnwindSafe,
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