[][src]Struct basn1::der::reader::Reader

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

ASN.1 DER Reader on slice

Implementations

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

pub fn new(slice: &'a [u8]) -> Self[src]

Create a new DER Reader where the read buffer is given by the user

pub fn anything(&mut self) -> Result<(Identifier, Length, &'a [u8]), Error>[src]

Get the next Tag / Length / Value triple, whichever it is

pub fn bool(&mut self) -> Result<bool, Error>[src]

Get the next boolean from the stream

pub fn integer(&mut self) -> Result<&'a Integer, Error>[src]

Get the next integer from the stream

pub fn enumerated(&mut self) -> Result<&'a Enumerated, Error>[src]

Get the next enumerated from the stream

pub fn bitstring(&mut self) -> Result<&'a BitString, Error>[src]

Get the next bitstring from the stream

pub fn octetstring(&mut self) -> Result<&'a [u8], Error>[src]

Get the next octetstring from the stream

pub fn utf8_string(&mut self) -> Result<&'a str, Error>[src]

Get the next utf8 string from the stream

pub fn null(&mut self) -> Result<(), Error>[src]

Get the next null from the stream

pub fn oid(&mut self) -> Result<&'a OID, Error>[src]

Get the next OID from the stream

pub fn sequence(&mut self) -> Result<Reader<'a>, Error>[src]

Get the next sequence from the stream as a Reader

pub fn set<A, F>(&mut self, f: F) -> Result<Set<'a, F>, Error> where
    F: Fn(Reader<'a>) -> Result<A, Error>, 
[src]

Get the next set from the stream as a Set iterator

pub fn done(&self) -> Result<(), Error>[src]

Check is the stream is done

If the reader is not finished, then the Error::ReaderNotTerminated is returned

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

Get the position of the reader in the slice

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

Get the remaining buffer as a slice

Trait Implementations

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

Auto Trait Implementations

impl<'a> Send for Reader<'a>

impl<'a> Sync for Reader<'a>

impl<'a> Unpin for Reader<'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.