Struct asn1_rs::SequenceOf
source · [−]pub struct SequenceOf<T> { /* private fields */ }
Expand description
The SEQUENCE OF
object is an ordered list of homogeneous types.
Examples
use asn1_rs::SequenceOf;
use std::iter::FromIterator;
// build set
let it = [2, 3, 4].iter();
let seq = SequenceOf::from_iter(it);
// `seq` now contains the serialized DER representation of the array
// iterate objects
let mut sum = 0;
for item in seq.iter() {
// item has type `Result<u32>`, since parsing the serialized bytes could fail
sum += *item;
}
assert_eq!(sum, 9);
Implementations
sourceimpl<T> SequenceOf<T>
impl<T> SequenceOf<T>
Trait Implementations
sourceimpl<'a, T> AsRef<[T]> for SequenceOf<T>
impl<'a, T> AsRef<[T]> for SequenceOf<T>
sourceimpl<T> CheckDerConstraints for SequenceOf<T> where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for SequenceOf<T> where
T: CheckDerConstraints,
fn check_constraints(any: &Any<'_>) -> Result<()>
sourceimpl<T: Debug> Debug for SequenceOf<T>
impl<T: Debug> Debug for SequenceOf<T>
sourceimpl<T> From<SequenceOf<T>> for Vec<T>
impl<T> From<SequenceOf<T>> for Vec<T>
sourcefn from(set: SequenceOf<T>) -> Self
fn from(set: SequenceOf<T>) -> Self
Converts to this type from the input type.
sourceimpl<T> FromIterator<T> for SequenceOf<T>
impl<T> FromIterator<T> for SequenceOf<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 SequenceOf<T>
impl<'a, T> IntoIterator for &'a SequenceOf<T>
sourceimpl<'a, T> IntoIterator for &'a mut SequenceOf<T>
impl<'a, T> IntoIterator for &'a mut SequenceOf<T>
sourceimpl<T> ToDer for SequenceOf<T> where
T: ToDer,
impl<T> ToDer for SequenceOf<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
sourceimpl<'a, T> TryFrom<Any<'a>> for SequenceOf<T> where
T: FromBer<'a>,
impl<'a, T> TryFrom<Any<'a>> for SequenceOf<T> where
T: FromBer<'a>,
impl<T> DerAutoDerive for SequenceOf<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for SequenceOf<T> where
T: RefUnwindSafe,
impl<T> Send for SequenceOf<T> where
T: Send,
impl<T> Sync for SequenceOf<T> where
T: Sync,
impl<T> Unpin for SequenceOf<T> where
T: Unpin,
impl<T> UnwindSafe for SequenceOf<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