[][src]Struct asn1_der::typed::Sequence

pub struct Sequence<'a> { /* fields omitted */ }

An ASN.1-DER sequence view

Methods

impl<'a> Sequence<'a>[src]

pub fn new<S: Sink + Into<&'a [u8]>, T: DerEncodable>(
    objs: &[T],
    sink: S
) -> Result<Self, Asn1DerError>
[src]

Writes a new sequence object with objs as subobjects into sink and returns a type view over it

pub fn len(&self) -> usize[src]

The amount of subelements in the sequence

Note: since there is no underlying index, the amount of subelements has to be recomputed every time. If you need the length more than once, consider caching it.

pub fn get(&self, n: usize) -> Result<DerObject<'a>, Asn1DerError>[src]

Gets the nth subobject

Note: since there is no underlying index, the position of each subelement has to be recomputed every time. If you need the subobjects more than once, consider caching them.

pub fn get_as<T: DerDecodable<'a>>(&self, n: usize) -> Result<T, Asn1DerError>[src]

Gets the nth subobject as T

Note: since there is no underlying index, the position of each subelement has to be recomputed every time. If you need the subobjects more than once, consider caching them.

pub fn write<S: Sink, T: DerEncodable>(
    objs: &[T],
    sink: &mut S
) -> Result<(), Asn1DerError>
[src]

Writes a sequence consisting of objs as DER-object to sink

Trait Implementations

impl<'a> Clone for Sequence<'a>[src]

impl<'a> Copy for Sequence<'a>[src]

impl<'a> DerDecodable<'a> for Sequence<'a>[src]

fn load(object: DerObject<'a>) -> Result<Self, Asn1DerError>[src]

Loads the Sequence and performs a shallow validation that each underlying object is a valid DER object

Note: This function does not look "into" the underlying elements nor does it perform any type-specific validation – only the tag-length constructions are validated.

impl<'a> DerEncodable for Sequence<'a>[src]

fn encode<S: Sink>(&self, sink: &mut S) -> Result<(), Asn1DerError>[src]

Encodes self to sink

impl<'a> DerTypeView<'a> for Sequence<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Sequence<'a>

impl<'a> Send for Sequence<'a>

impl<'a> Sync for Sequence<'a>

impl<'a> Unpin for Sequence<'a>

impl<'a> UnwindSafe for Sequence<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.