pub struct BoundedVec<T, const N: usize>(/* private fields */);
Expand description
Wrapper for Vec
that has an explicit upper bound on the number of elements.
The Structure remains heap-allocated to avoid blowing up the size of types where it is used.
Trait Implementations§
Source§impl<T: Clone, const N: usize> Clone for BoundedVec<T, N>
impl<T: Clone, const N: usize> Clone for BoundedVec<T, N>
Source§fn clone(&self) -> BoundedVec<T, N>
fn clone(&self) -> BoundedVec<T, N>
Returns a copy 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 N: usize> Default for BoundedVec<T, N>
impl<T, const N: usize> Default for BoundedVec<T, N>
Source§impl<'de, T, const N: usize> Deserialize<'de> for BoundedVec<T, N>where
T: Deserialize<'de>,
impl<'de, T, const N: usize> Deserialize<'de> for BoundedVec<T, N>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Default + Copy, const N: usize> From<BoundedVec<T, N>> for [T; N]
impl<T: Default + Copy, const N: usize> From<BoundedVec<T, N>> for [T; N]
Source§fn from(value: BoundedVec<T, N>) -> Self
fn from(value: BoundedVec<T, N>) -> Self
Converts to this type from the input type.
Source§impl<T, const N: usize> From<BoundedVec<T, N>> for Vec<T>
impl<T, const N: usize> From<BoundedVec<T, N>> for Vec<T>
Source§fn from(value: BoundedVec<T, N>) -> Self
fn from(value: BoundedVec<T, N>) -> Self
Converts to this type from the input type.
Source§impl<T, const N: usize> FromIterator<T> for BoundedVec<T, N>
impl<T, const N: usize> FromIterator<T> for BoundedVec<T, N>
Source§fn from_iter<V: IntoIterator<Item = T>>(iter: V) -> Self
fn from_iter<V: IntoIterator<Item = T>>(iter: V) -> Self
Creates a value from an iterator. Read more
Source§impl<T, const N: usize> IntoIterator for BoundedVec<T, N>
impl<T, const N: usize> IntoIterator for BoundedVec<T, N>
impl<T: Eq, const N: usize> Eq for BoundedVec<T, N>
impl<T, const N: usize> StructuralPartialEq for BoundedVec<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for BoundedVec<T, N>
impl<T, const N: usize> RefUnwindSafe for BoundedVec<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for BoundedVec<T, N>where
T: Send,
impl<T, const N: usize> Sync for BoundedVec<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for BoundedVec<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for BoundedVec<T, N>where
T: UnwindSafe,
Blanket Implementations§
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)