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
sourceimpl<T> CheckDerConstraints for SetOf<T> where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for SetOf<T> where
T: CheckDerConstraints,
fn check_constraints(any: &Any<'_>) -> Result<()>
sourceimpl<T> FromIterator<T> for SetOf<T>
impl<T> FromIterator<T> for SetOf<T>
sourcefn 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
sourceimpl<'a, T> IntoIterator for &'a SetOf<T>
impl<'a, T> IntoIterator for &'a SetOf<T>
sourceimpl<'a, T> IntoIterator for &'a mut SetOf<T>
impl<'a, T> IntoIterator for &'a mut SetOf<T>
sourceimpl<T> ToDer for SetOf<T> where
T: ToDer,
impl<T> ToDer for SetOf<T> where
T: ToDer,
sourcefn to_der_len(&self) -> Result<usize>
fn to_der_len(&self) -> Result<usize>
Get the length of the object, when encoded Read more
sourcefn 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.
sourcefn 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.
sourcefn 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>
.
sourcefn 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. Read more
sourcefn 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
sourcefn 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. Read more
impl<T> DerAutoDerive for SetOf<T>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more