[][src]Struct cborian::decoder::Kernel

pub struct Kernel<R> { /* fields omitted */ }

This decoding kernel reads from an underlying std::io::Read type primitive CBOR values such as unsigned and signed integers as well as raw bytes. It forms the basis on which Decoder and GenericDecoder add logic for handling Tags, heterogenous data and generic value decoding.

Implementations

impl<R: ReadBytesExt> Kernel<R>[src]

pub fn new(r: R) -> Kernel<R>[src]

pub fn into_reader(self) -> R[src]

pub fn typeinfo(&mut self) -> DecodeResult<TypeInfo>[src]

pub fn simple(&mut self, ti: &TypeInfo) -> DecodeResult<Simple>[src]

pub fn bool(&mut self, ti: &TypeInfo) -> DecodeResult<bool>[src]

pub fn u8(&mut self, ti: &TypeInfo) -> DecodeResult<u8>[src]

pub fn u16(&mut self, ti: &TypeInfo) -> DecodeResult<u16>[src]

pub fn u32(&mut self, ti: &TypeInfo) -> DecodeResult<u32>[src]

pub fn u64(&mut self, ti: &TypeInfo) -> DecodeResult<u64>[src]

pub fn i8(&mut self, ti: &TypeInfo) -> DecodeResult<i8>[src]

pub fn i16(&mut self, ti: &TypeInfo) -> DecodeResult<i16>[src]

pub fn i32(&mut self, ti: &TypeInfo) -> DecodeResult<i32>[src]

pub fn i64(&mut self, ti: &TypeInfo) -> DecodeResult<i64>[src]

pub fn int(&mut self, ti: &TypeInfo) -> DecodeResult<Int>[src]

pub fn f16(&mut self, ti: &TypeInfo) -> DecodeResult<f32>[src]

pub fn f32(&mut self, ti: &TypeInfo) -> DecodeResult<f32>[src]

pub fn f64(&mut self, ti: &TypeInfo) -> DecodeResult<f64>[src]

pub fn unsigned(&mut self, first: u8) -> DecodeResult<u64>[src]

Decode first and potentially the following bytes as an unsigned value following the rules of major type 0.

pub fn raw_data(&mut self, begin: u8, max_len: usize) -> DecodeResult<Vec<u8>>[src]

Read begin as the length and return that many raw bytes.

If length is greater than the given max_len, DecodeError::TooLong is returned instead.

pub fn read_raw_data(
    &mut self,
    begin: u8,
    buf: &mut [u8]
) -> DecodeResult<usize>
[src]

Read begin as the length and read that many raw bytes into buf.

If length is greater than the given buffer, DecodeError::TooLong is returned instead.

impl<R: ReadBytesExt + ReadSlice> Kernel<R>[src]

pub fn raw_slice(&mut self, begin: u8, max_len: usize) -> DecodeResult<&[u8]>[src]

Read begin as the length and return that many raw bytes as a slice.

If length is greater than the given max_len, DecodeError::TooLong is returned instead.

Auto Trait Implementations

impl<R> RefUnwindSafe for Kernel<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for Kernel<R> where
    R: Send
[src]

impl<R> Sync for Kernel<R> where
    R: Sync
[src]

impl<R> Unpin for Kernel<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for Kernel<R> where
    R: UnwindSafe
[src]

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,