[][src]Struct asn1_der::DerObject

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

An untyped DER object

Methods

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

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

Writes a new DER object with tag and value into sink and returns a view over it

pub fn new_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
    tag: u8,
    len: usize,
    value: &mut A,
    sink: B
) -> Result<Self, Asn1DerError>
[src]

Writes a new DER object with tag, len and value into sink and returns a view over it

pub fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>[src]

Decodes an object from raw

pub fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
    source: &mut A,
    sink: B
) -> Result<Self, Asn1DerError>
[src]

Reads a DER-TLV structure from source by parsing the length field and copying the necessary bytes into sink and returns a view over it

pub fn raw(self) -> &'a [u8][src]

The underlying raw slice

pub fn header(self) -> &'a [u8][src]

The object header

pub fn tag(self) -> u8[src]

The object tag

pub fn value(self) -> &'a [u8][src]

The object value

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

Encodes self to sink

Trait Implementations

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

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

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

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for DerObject<'a>

impl<'a> Send for DerObject<'a>

impl<'a> Sync for DerObject<'a>

impl<'a> Unpin for DerObject<'a>

impl<'a> UnwindSafe for DerObject<'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.