Skip to main content

DerReader

Struct DerReader 

Source
pub struct DerReader<R: Read> { /* private fields */ }

Implementations§

Source§

impl<'a> DerReader<&'a [u8]>

Source

pub fn from_bytes(input: &'a impl AsRef<[u8]>) -> Self

Source§

impl<R: Read> DerReader<R>

Source

pub fn from_reader(input: R) -> Self

Source

pub fn next(&mut self) -> Result<Option<DerType>, DerError>

Source

pub fn skip_contents(&mut self) -> Result<(), DerError>

Source

pub fn is_constructed(&self) -> bool

Source

pub fn is_primitive(&self) -> bool

Source

pub fn contents(&self) -> Option<&[u8]>

Source

pub fn to_null(&self) -> Result<(), DerError>

Source

pub fn to_boolean(&self) -> Result<bool, DerError>

Source

pub fn to_u8(&self) -> Result<u8, DerError>

Source

pub fn to_u64(&self) -> Result<u64, DerError>

Source

pub fn to_be_bytes(&self, sign: bool, min_len: usize) -> Vec<u8>

Source

pub fn to_vec(&self) -> Result<Vec<u8>, DerError>

Source

pub fn to_bit_vec(&self) -> Result<(Vec<u8>, u8), DerError>

Source

pub fn to_string(&self) -> Result<String, DerError>

Source

pub fn to_object_identifier(&self) -> Result<ObjectIdentifier, DerError>

Auto Trait Implementations§

§

impl<R> Freeze for DerReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for DerReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for DerReader<R>
where R: Send,

§

impl<R> Sync for DerReader<R>
where R: Sync,

§

impl<R> Unpin for DerReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for DerReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for DerReader<R>
where R: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.