pub struct SetOfVec<T>where
T: DerOrd,{ /* private fields */ }Available on crate feature
alloc only.Expand description
ASN.1 SET OF backed by a Vec.
This type implements an append-only SET OF type which is heap-backed
and depends on alloc support.
Implementations§
Source§impl<T> SetOfVec<T>where
T: DerOrd,
impl<T> SetOfVec<T>where
T: DerOrd,
Sourcepub fn from_iter<I>(iter: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
Available on crate features alloc or heapless only.
pub fn from_iter<I>(iter: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
alloc or heapless only.Create a new SetOfVec from the given iterator.
Note: this is an inherent method instead of an impl of the FromIterator trait in order
to be fallible.
§Errors
If a sorting error occurred.
Sourcepub fn extend<I>(&mut self, iter: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
Available on crate features alloc or heapless only.
pub fn extend<I>(&mut self, iter: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
alloc or heapless only.Sourcepub fn insert(&mut self, item: T) -> Result<(), Error>
Available on crate features alloc or heapless only.
pub fn insert(&mut self, item: T) -> Result<(), Error>
alloc or heapless only.Sourcepub fn insert_ordered(&mut self, item: T) -> Result<(), Error>
Available on crate features alloc or heapless only.
pub fn insert_ordered(&mut self, item: T) -> Result<(), Error>
alloc or heapless only.Sourcepub fn as_slice(&self) -> &[T]
Available on crate features alloc or heapless only.
pub fn as_slice(&self) -> &[T]
alloc or heapless only.Borrow the elements of this SetOfVec as a slice.
Sourcepub fn get(&self, index: usize) -> Option<&T>
Available on crate features alloc or heapless only.
pub fn get(&self, index: usize) -> Option<&T>
alloc or heapless only.Get the nth element from this SetOfVec.
Sourcepub fn iter(&self) -> SetOfIter<'_, T> ⓘ
Available on crate features alloc or heapless only.
pub fn iter(&self) -> SetOfIter<'_, T> ⓘ
alloc or heapless only.Iterate over the elements of this SetOfVec.
Trait Implementations§
Source§impl<'a, T> Arbitrary<'a> for SetOfVec<T>
Available on (crate features alloc or heapless) and crate feature arbitrary only.
impl<'a, T> Arbitrary<'a> for SetOfVec<T>
Available on (crate features
alloc or heapless) and crate feature arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn size_hint(_depth: usize) -> (usize, Option<usize>)
fn size_hint(_depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<T> AsRef<[T]> for SetOfVec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T> AsRef<[T]> for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Source§impl<'a, T> DecodeValue<'a> for SetOfVec<T>
Available on crate features alloc or heapless only.
impl<'a, T> DecodeValue<'a> for SetOfVec<T>
Available on crate features
alloc or heapless only.Source§impl<T> EncodeValue for SetOfVec<T>
Available on crate features alloc or heapless only.
impl<T> EncodeValue for SetOfVec<T>
Available on crate features
alloc or heapless only.Source§impl<T> FixedTag for SetOfVec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T> FixedTag for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Source§impl<T> From<SetOfVec<T>> for Vec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T> From<SetOfVec<T>> for Vec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Source§impl<T> Ord for SetOfVec<T>
Available on crate features alloc or heapless only.
impl<T> Ord for SetOfVec<T>
Available on crate features
alloc or heapless only.1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialOrd for SetOfVec<T>where
T: DerOrd + PartialOrd,
Available on crate features alloc or heapless only.
impl<T> PartialOrd for SetOfVec<T>where
T: DerOrd + PartialOrd,
Available on crate features
alloc or heapless only.Source§impl<T, const N: usize> TryFrom<[T; N]> for SetOfVec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T, const N: usize> TryFrom<[T; N]> for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Source§impl<T> TryFrom<Vec<T>> for SetOfVec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T> TryFrom<Vec<T>> for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Source§impl<T> ValueOrd for SetOfVec<T>where
T: DerOrd,
Available on crate features alloc or heapless only.
impl<T> ValueOrd for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.impl<T> Eq for SetOfVec<T>
Available on crate features
alloc or heapless only.impl<T> StructuralPartialEq for SetOfVec<T>where
T: DerOrd,
Available on crate features
alloc or heapless only.Auto Trait Implementations§
impl<T> Freeze for SetOfVec<T>
impl<T> RefUnwindSafe for SetOfVec<T>where
T: RefUnwindSafe,
impl<T> Send for SetOfVec<T>where
T: Send,
impl<T> Sync for SetOfVec<T>where
T: Sync,
impl<T> Unpin for SetOfVec<T>where
T: Unpin,
impl<T> UnwindSafe for SetOfVec<T>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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
Source§type Error = <T as DecodeValue<'a>>::Error
type Error = <T as DecodeValue<'a>>::Error
Type returned in the event of a decoding error.
Source§fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
Attempt to decode this TLV message using the provided decoder. Read more
Source§fn from_ber(bytes: &'a [u8]) -> Result<Self, Self::Error>
fn from_ber(bytes: &'a [u8]) -> Result<Self, Self::Error>
Available on crate feature
ber only.Parse
Self from the provided BER-encoded byte slice. Read moreSource§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more
Source§impl<T> IsConstructed for T
impl<T> IsConstructed for T
Source§const CONSTRUCTED: bool = const CONSTRUCTED: bool = T::TAG.is_constructed();
const CONSTRUCTED: bool = const CONSTRUCTED: bool = T::TAG.is_constructed();
ASN.1 constructed bit