ByteDecode

Trait ByteDecode 

Source
pub trait ByteDecode {
    // Required method
    fn decode_inner<I: BufRead>(
        input: &I,
        cattr: Option<&ContainerAttrModifiers>,
        fattr: Option<&FieldAttrModifiers<'_>>,
    ) -> JResult<Self>
       where Self: Sized;

    // Provided method
    fn decode<I: BufRead>(input: &I) -> JResult<Self>
       where Self: Sized { ... }
}
Expand description

This is bytes decoding trait.

§Example

use jbytes::{
    JResult, BufRead,
    ByteDecode, BorrowByteDecode,
    ContainerAttrModifiers, FieldAttrModifiers,
};
 
 
impl ByteDecode for bool {
    fn decode_inner<I: BufRead>(input: &I, _cattr: Option<&ContainerAttrModifiers>,
                                           _fattr: Option<&FieldAttrModifiers>) -> JResult<Self>
    where 
        Self: Sized
    {
        input.take_bool()
    }
}

Required Methods§

Source

fn decode_inner<I: BufRead>( input: &I, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Provided Methods§

Source

fn decode<I: BufRead>(input: &I) -> JResult<Self>
where Self: Sized,

Implementations on Foreign Types§

Source§

impl ByteDecode for bool

Source§

fn decode_inner<T: BufRead>( input: &T, _cattr: Option<&ContainerAttrModifiers>, _fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for char

Source§

fn decode_inner<T: BufRead>( input: &T, _cattr: Option<&ContainerAttrModifiers>, _fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for f32

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for f64

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for i8

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for i16

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for i32

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for i64

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for i128

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for isize

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for u8

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for u16

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for u32

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for u64

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for u128

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl ByteDecode for usize

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<K, V> ByteDecode for HashMap<K, V>
where K: ByteDecode + Hash + Eq, V: ByteDecode + Hash + Eq,

Source§

fn decode_inner<I: BufRead>( input: &I, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<T> ByteDecode for HashSet<T>
where T: ByteDecode + Hash + Eq,

Source§

fn decode_inner<I: BufRead>( input: &I, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<T: ByteDecode> ByteDecode for Option<T>

Source§

fn decode_inner<I: BufRead>( input: &I, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<T: ByteDecode, const N: usize> ByteDecode for [T; N]

Source§

fn decode_inner<I: BufRead>( input: &I, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode> ByteDecode for (t1,)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode> ByteDecode for (t1, t2)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode> ByteDecode for (t1, t2, t3)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode> ByteDecode for (t1, t2, t3, t4)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode, t5: ByteDecode> ByteDecode for (t1, t2, t3, t4, t5)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode, t5: ByteDecode, t6: ByteDecode> ByteDecode for (t1, t2, t3, t4, t5, t6)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode, t5: ByteDecode, t6: ByteDecode, t7: ByteDecode> ByteDecode for (t1, t2, t3, t4, t5, t6, t7)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode, t5: ByteDecode, t6: ByteDecode, t7: ByteDecode, t8: ByteDecode> ByteDecode for (t1, t2, t3, t4, t5, t6, t7, t8)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Source§

impl<t1: ByteDecode, t2: ByteDecode, t3: ByteDecode, t4: ByteDecode, t5: ByteDecode, t6: ByteDecode, t7: ByteDecode, t8: ByteDecode, t9: ByteDecode> ByteDecode for (t1, t2, t3, t4, t5, t6, t7, t8, t9)

Source§

fn decode_inner<T: BufRead>( input: &T, cattr: Option<&ContainerAttrModifiers>, fattr: Option<&FieldAttrModifiers<'_>>, ) -> JResult<Self>
where Self: Sized,

Implementors§