pub struct CuArrayVec<T, const N: usize>(pub ArrayVec<T, N>);
Expand description
A Copper-friendly wrapper around ArrayVec with bincode serialization support.
This provides a fixed-capacity, stack-allocated vector that can be efficiently serialized and deserialized. It is particularly useful for message payloads that need to avoid heap allocations while supporting varying lengths of data up to a maximum.
Unlike standard Vec, CuArrayVec will never reallocate or use the heap for the elements storage.
Tuple Fields§
§0: ArrayVec<T, N>
Trait Implementations§
Source§impl<'de, T, const N: usize> BorrowDecode<'de, ()> for CuArrayVec<T, N>where
T: BorrowDecode<'de, ()> + 'static,
impl<'de, T, const N: usize> BorrowDecode<'de, ()> for CuArrayVec<T, N>where
T: BorrowDecode<'de, ()> + 'static,
Source§fn borrow_decode<D>(decoder: &mut D) -> Result<CuArrayVec<T, N>, DecodeError>where
D: BorrowDecoder<'de, Context = ()>,
fn borrow_decode<D>(decoder: &mut D) -> Result<CuArrayVec<T, N>, DecodeError>where
D: BorrowDecoder<'de, Context = ()>,
Attempt to decode this type with the given BorrowDecode.
Source§impl<T, const N: usize> Clone for CuArrayVec<T, N>where
T: Clone,
impl<T, const N: usize> Clone for CuArrayVec<T, N>where
T: Clone,
Source§fn clone(&self) -> CuArrayVec<T, N>
fn clone(&self) -> CuArrayVec<T, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, const N: usize> Decode<()> for CuArrayVec<T, N>
impl<T, const N: usize> Decode<()> for CuArrayVec<T, N>
Source§fn decode<D>(decoder: &mut D) -> Result<CuArrayVec<T, N>, DecodeError>
fn decode<D>(decoder: &mut D) -> Result<CuArrayVec<T, N>, DecodeError>
Attempt to decode this type with the given Decode.
Source§impl<T, const N: usize> Default for CuArrayVec<T, N>
impl<T, const N: usize> Default for CuArrayVec<T, N>
Source§fn default() -> CuArrayVec<T, N>
fn default() -> CuArrayVec<T, N>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T, const N: usize> Freeze for CuArrayVec<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for CuArrayVec<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for CuArrayVec<T, N>where
T: Send,
impl<T, const N: usize> Sync for CuArrayVec<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for CuArrayVec<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for CuArrayVec<T, N>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