pub struct NestedReader<'i, R> { /* private fields */ }
Available on crate feature pkcs8 only.
Expand description

Reader type used by Reader::read_nested.

Trait Implementations§

§

impl<'i, 'r, R> Reader<'r> for NestedReader<'i, R>
where R: Reader<'r>,

§

fn input_len(&self) -> Length

Get the length of the input.
§

fn peek_byte(&self) -> Option<u8>

Peek at the next byte of input without modifying the cursor.
§

fn peek_header(&self) -> Result<Header, Error>

Peek forward in the input data, attempting to decode a Header from the data at the current position in the decoder. Read more
§

fn position(&self) -> Length

Get the position within the buffer.
§

fn read_slice(&mut self, len: Length) -> Result<&'r [u8], Error>

Attempt to read data borrowed directly from the input as a slice, updating the internal cursor position. Read more
§

fn error(&mut self, kind: ErrorKind) -> Error

Return an error with the given ErrorKind, annotating it with context about where the error occurred.
§

fn offset(&self) -> Length

Offset within the original input stream. Read more
§

fn read_into<'o>(&mut self, out: &'o mut [u8]) -> Result<&'o [u8], Error>

Attempt to read input data, writing it into the provided buffer, and returning a slice on success. Read more
§

fn context_specific<T>( &mut self, tag_number: TagNumber, tag_mode: TagMode ) -> Result<Option<T>, Error>
where T: DecodeValue<'r> + FixedTag,

Attempt to decode an ASN.1 CONTEXT-SPECIFIC field with the provided TagNumber.
§

fn decode<T>(&mut self) -> Result<T, Error>
where T: Decode<'r>,

Decode a value which impls the Decode trait.
§

fn finish<T>(self, value: T) -> Result<T, Error>

Finish decoding, returning the given value if there is no remaining data, or an error otherwise
§

fn is_finished(&self) -> bool

Have we read all of the input data?
§

fn peek_tag(&self) -> Result<Tag, Error>

Peek at the next byte in the decoder and attempt to decode it as a Tag value. Read more
§

fn read_byte(&mut self) -> Result<u8, Error>

Read a single byte.
§

fn read_nested<'n, T, F>(&'n mut self, len: Length, f: F) -> Result<T, Error>
where F: FnOnce(&mut NestedReader<'n, Self>) -> Result<T, Error>,

Read nested data of the given length.
§

fn read_vec(&mut self, len: Length) -> Result<Vec<u8>, Error>

Available on crate feature alloc only.
Read a byte vector of the given length.
§

fn remaining_len(&self) -> Length

Get the number of bytes still remaining in the buffer.
§

fn sequence<'n, F, T>(&'n mut self, f: F) -> Result<T, Error>
where F: FnOnce(&mut NestedReader<'n, Self>) -> Result<T, Error>,

Read an ASN.1 SEQUENCE, creating a nested Reader for the body and calling the provided closure with it.
§

fn tlv_bytes(&mut self) -> Result<&'r [u8], Error>

Obtain a slice of bytes contain a complete TLV production suitable for parsing later.

Auto Trait Implementations§

§

impl<'i, R> RefUnwindSafe for NestedReader<'i, R>
where R: RefUnwindSafe,

§

impl<'i, R> Send for NestedReader<'i, R>
where R: Send,

§

impl<'i, R> Sync for NestedReader<'i, R>
where R: Sync,

§

impl<'i, R> Unpin for NestedReader<'i, R>

§

impl<'i, R> !UnwindSafe for NestedReader<'i, R>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.