[][src]Trait dsf_core::base::Parse

pub trait Parse {
    type Output;
    type Error;
    fn parse(buff: &[u8]) -> Result<(Self::Output, usize), Self::Error>;

    fn parse_iter<'a>(
        buff: &'a [u8]
    ) -> ParseIter<'a, Self::Output, Self::Error>

Notable traits for ParseIter<'a, T, E>

impl<'a, T, E> Iterator for ParseIter<'a, T, E> where
    T: Parse<Output = T, Error = E>, 
type Item = Result<T, E>;
{ ... } }

Parse trait for building parse-able objects

Associated Types

type Output

Output type returned from parsing

type Error

Error type returned on parse error

Loading content...

Required methods

fn parse(buff: &[u8]) -> Result<(Self::Output, usize), Self::Error>

Parse method consumes a slice and returns an object and the remaining slice.

Loading content...

Provided methods

fn parse_iter<'a>(buff: &'a [u8]) -> ParseIter<'a, Self::Output, Self::Error>

Notable traits for ParseIter<'a, T, E>

impl<'a, T, E> Iterator for ParseIter<'a, T, E> where
    T: Parse<Output = T, Error = E>, 
type Item = Result<T, E>;

Parse iter consumes a slice and returns an iterator over decoded objects

Loading content...

Implementations on Foreign Types

impl Parse for String[src]

type Output = String

type Error = OptionsError

impl Parse for Vec<u8>[src]

type Output = Vec<u8>

type Error = OptionsError

Loading content...

Implementors

impl Parse for Options[src]

Parse parses a control option from the given scope

type Output = Options

type Error = OptionsError

impl Parse for Expiry[src]

type Output = Expiry

type Error = OptionsError

impl Parse for Issued[src]

type Output = Issued

type Error = OptionsError

impl Parse for Kind[src]

type Output = Kind

type Error = OptionsError

impl Parse for Limit[src]

type Output = Self

type Error = OptionsError

impl Parse for Metadata[src]

type Output = Metadata

type Error = OptionsError

impl Parse for Name[src]

type Output = Name

type Error = OptionsError

impl Parse for PeerId[src]

type Output = PeerId

type Error = OptionsError

impl Parse for PrevSig[src]

type Output = Self

type Error = OptionsError

impl Parse for PubKey[src]

type Output = PubKey

type Error = OptionsError

impl Parse for AddressV4[src]

type Output = AddressV4

type Error = OptionsError

impl Parse for AddressV6[src]

type Output = AddressV6

type Error = OptionsError

impl Parse for DateTime[src]

type Output = DateTime

type Error = OptionsError

Loading content...