Skip to main content

DecodingStream

Struct DecodingStream 

Source
pub struct DecodingStream<'a> { /* private fields */ }
Expand description

Decoding stream for efficient multi-value decoding

Implementations§

Source§

impl<'a> DecodingStream<'a>

Source

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

Create a new decoding stream

Source

pub fn has_data(&self) -> bool

Check if stream has more data

Source

pub fn remaining(&self) -> usize

Get remaining bytes

Source

pub fn peek_tag(&self) -> Result<ApplicationTag>

Peek at the next tag without consuming

Source

pub fn decode_boolean(&mut self) -> Result<bool>

Decode a boolean

Source

pub fn decode_unsigned(&mut self) -> Result<u32>

Decode an unsigned integer

Source

pub fn decode_signed(&mut self) -> Result<i32>

Decode a signed integer

Source

pub fn decode_real(&mut self) -> Result<f32>

Decode a real number

Source

pub fn decode_double(&mut self) -> Result<f64>

Decode a double

Source

pub fn decode_character_string(&mut self) -> Result<String>

Decode a character string

Source

pub fn decode_octet_string(&mut self) -> Result<Vec<u8>>

Decode an octet string

Source

pub fn decode_enumerated(&mut self) -> Result<u32>

Decode an enumerated value

Source

pub fn decode_date(&mut self) -> Result<(u16, u8, u8, u8)>

Decode a date

Source

pub fn decode_time(&mut self) -> Result<(u8, u8, u8, u8)>

Decode a time

Source

pub fn decode_object_identifier(&mut self) -> Result<ObjectIdentifier>

Decode an object identifier

Source

pub fn skip_value(&mut self) -> Result<()>

Skip a value

Source

pub fn position(&self) -> usize

Get current position

Source

pub fn set_position(&mut self, position: usize) -> Result<()>

Set position

Auto Trait Implementations§

§

impl<'a> Freeze for DecodingStream<'a>

§

impl<'a> RefUnwindSafe for DecodingStream<'a>

§

impl<'a> Send for DecodingStream<'a>

§

impl<'a> Sync for DecodingStream<'a>

§

impl<'a> Unpin for DecodingStream<'a>

§

impl<'a> UnsafeUnpin for DecodingStream<'a>

§

impl<'a> UnwindSafe for DecodingStream<'a>

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.