Decode

Trait Decode 

Source
pub trait Decode: Sized {
    // Required method
    fn decode<'a, I: Iterator<Item = &'a SExprItem>>(
        items: &mut Peekable<I>,
    ) -> Result<Self>;
}

Required Methods§

Source

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Consumes zero or more S-expression items from the iterator to construct Self.

§Errors

Will return an error if the S-expression cannot be represented by Self. To avoid this case, use can_decode to check if the item can be decoded first.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Decode for bool

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl Decode for i64

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl Decode for u64

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl Decode for String

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl<T: Decode> Decode for Option<T>

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl<T: Decode> Decode for Box<T>

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Source§

impl<T: Decode> Decode for Vec<T>

Source§

fn decode<'a, I: Iterator<Item = &'a SExprItem>>( items: &mut Peekable<I>, ) -> Result<Self>

Implementors§