pub struct SetOf<T> { /* private fields */ }
Expand description
The SET OF
object is an unordered list of homogeneous types.
§Examples
use asn1_rs::SetOf;
use std::iter::FromIterator;
// build set
let it = [2, 3, 4].iter();
let set = SetOf::from_iter(it);
// `set` now contains the serialized DER representation of the array
// iterate objects
let mut sum = 0;
for item in set.iter() {
// item has type `Result<u32>`, since parsing the serialized bytes could fail
sum += *item;
}
assert_eq!(sum, 9);
Implementations§
Trait Implementations§
source§impl<T> CheckDerConstraints for SetOf<T>where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for SetOf<T>where
T: CheckDerConstraints,
source§impl<T> FromIterator<T> for SetOf<T>
impl<T> FromIterator<T> for SetOf<T>
source§fn from_iter<IT: IntoIterator<Item = T>>(iter: IT) -> Self
fn from_iter<IT: IntoIterator<Item = T>>(iter: IT) -> Self
Creates a value from an iterator. Read more
source§impl<'a, T> IntoIterator for &'a SetOf<T>
impl<'a, T> IntoIterator for &'a SetOf<T>
source§impl<'a, T> IntoIterator for &'a mut SetOf<T>
impl<'a, T> IntoIterator for &'a mut SetOf<T>
source§impl<T> ToDer for SetOf<T>where
T: ToDer,
impl<T> ToDer for SetOf<T>where
T: ToDer,
source§fn to_der_len(&self) -> Result<usize>
fn to_der_len(&self) -> Result<usize>
Get the length of the object (including the header), when encoded
source§fn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER header to this writer.
source§fn write_der_content(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_content(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER content (all except header) to this writer.
source§fn to_der_vec(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec(&self) -> SerializeResult<Vec<u8>>
Write the DER encoded representation to a newly allocated
Vec<u8>
.source§fn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
Similar to using
to_vec
, but uses provided values without changes.
This can generate an invalid encoding for a DER object.source§fn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
source§fn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Similar to using
to_der
, but uses provided values without changes.
This can generate an invalid encoding for a DER object.impl<T> DerAutoDerive for SetOf<T>
Auto Trait Implementations§
impl<T> Freeze for SetOf<T>
impl<T> RefUnwindSafe for SetOf<T>where
T: RefUnwindSafe,
impl<T> Send for SetOf<T>where
T: Send,
impl<T> Sync for SetOf<T>where
T: Sync,
impl<T> Unpin for SetOf<T>where
T: Unpin,
impl<T> UnwindSafe for SetOf<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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