[−][src]Struct asn1_der::typed::Sequence
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]
objs: &[T],
sink: S
) -> Result<Self, Asn1DerError>
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 n
th 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 n
th 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]
objs: &[T],
sink: &mut S
) -> Result<(), Asn1DerError>
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.
fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>
[src]
fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>
[src]
fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
[src]
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
impl<'a> DerEncodable for Sequence<'a>
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,