pub struct SequenceOf<T> { /* private fields */ }
mtls
only.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
impl<T> SequenceOf<T>
impl<T> SequenceOf<T>
pub const fn new(items: Vec<T, Global>) -> SequenceOf<T>
pub const fn new(items: Vec<T, Global>) -> SequenceOf<T>
Builds a SEQUENCE OF
from the provided content
Trait Implementations
impl<'a, T> AsRef<[T]> for SequenceOf<T>
impl<'a, T> AsRef<[T]> for SequenceOf<T>
impl<T> CheckDerConstraints for SequenceOf<T> where
T: CheckDerConstraints,
impl<T> CheckDerConstraints for SequenceOf<T> where
T: CheckDerConstraints,
fn check_constraints(any: &Any<'_>) -> Result<(), Error>
impl<T> Debug for SequenceOf<T> where
T: Debug,
impl<T> Debug for SequenceOf<T> where
T: Debug,
impl<T> From<SequenceOf<T>> for Vec<T, Global>
impl<T> From<SequenceOf<T>> for Vec<T, Global>
impl<T> FromIterator<T> for SequenceOf<T>
impl<T> FromIterator<T> for SequenceOf<T>
fn from_iter<IT>(iter: IT) -> SequenceOf<T> where
IT: IntoIterator<Item = T>,
fn from_iter<IT>(iter: IT) -> SequenceOf<T> where
IT: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
impl<'a, T> IntoIterator for &'a SequenceOf<T>
impl<'a, T> IntoIterator for &'a SequenceOf<T>
impl<'a, T> IntoIterator for &'a mut SequenceOf<T>
impl<'a, T> IntoIterator for &'a mut SequenceOf<T>
impl<T> Tagged for SequenceOf<T>
impl<T> Tagged for SequenceOf<T>
impl<T> ToDer for SequenceOf<T> where
T: ToDer,
impl<T> ToDer for SequenceOf<T> where
T: ToDer,
fn to_der_len(&self) -> Result<usize, Error>
fn to_der_len(&self) -> Result<usize, Error>
Get the length of the object, when encoded Read more
fn write_der_header(
&self,
writer: &mut dyn Write
) -> Result<usize, SerializeError>
fn write_der_header(
&self,
writer: &mut dyn Write
) -> Result<usize, SerializeError>
Attempt to write the DER header to this writer.
fn write_der_content(
&self,
writer: &mut dyn Write
) -> Result<usize, SerializeError>
fn write_der_content(
&self,
writer: &mut dyn Write
) -> Result<usize, SerializeError>
Attempt to write the DER content (all except header) to this writer.
fn to_der_vec(&self) -> Result<Vec<u8, Global>, SerializeError>
fn to_der_vec(&self) -> Result<Vec<u8, Global>, SerializeError>
Write the DER encoded representation to a newly allocated Vec<u8>
.
fn to_der_vec_raw(&self) -> Result<Vec<u8, Global>, SerializeError>
fn to_der_vec_raw(&self) -> Result<Vec<u8, Global>, SerializeError>
Similar to using to_vec
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>
Similar to using to_der
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
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
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
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
impl<T> Choice for T where
T: Tagged,
impl<T> Choice for T where
T: Tagged,
fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided Tag
decodable as a variant of this CHOICE
?
impl<'a, T> FromDer<'a> for T where
T: TryFrom<Any<'a>, Error = Error> + CheckDerConstraints,
impl<'a, T> FromDer<'a> for T where
T: TryFrom<Any<'a>, Error = Error> + CheckDerConstraints,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more