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§
source§impl<T> SequenceOf<T>
impl<T> SequenceOf<T>
Trait Implementations§
source§impl<T> AsRef<[T]> for SequenceOf<T>
impl<T> AsRef<[T]> for SequenceOf<T>
source§impl<T> CheckDerConstraints for SequenceOf<T>where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for SequenceOf<T>where
T: CheckDerConstraints,
source§impl<T: Debug> Debug for SequenceOf<T>
impl<T: Debug> Debug for SequenceOf<T>
source§impl<T> From<SequenceOf<T>> for Vec<T>
impl<T> From<SequenceOf<T>> for Vec<T>
source§fn from(set: SequenceOf<T>) -> Self
fn from(set: SequenceOf<T>) -> Self
Converts to this type from the input type.
source§impl<T> FromIterator<T> for SequenceOf<T>
impl<T> FromIterator<T> for SequenceOf<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 SequenceOf<T>
impl<'a, T> IntoIterator for &'a SequenceOf<T>
source§impl<'a, T> IntoIterator for &'a mut SequenceOf<T>
impl<'a, T> IntoIterator for &'a mut SequenceOf<T>
source§impl<T> ToDer for SequenceOf<T>where
T: ToDer,
impl<T> ToDer for SequenceOf<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 SequenceOf<T>
Auto Trait Implementations§
impl<T> Freeze for SequenceOf<T>
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§
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