[][src]Trait json_tools::IteratorExt

pub trait IteratorExt: Iterator<Item = Token> {
    fn filter_key_value_by_type(
        self,
        token_type: TokenType
    ) -> FilterTypedKeyValuePairs<Self>
    where
        Self: Sized
, { ... }
fn reader(self, source: Option<&str>) -> TokenReader<Self>
    where
        Self: Sized
, { ... } }

Applies convenience constructors to all Iterator<Item=Token> types

Provided methods

Important traits for FilterTypedKeyValuePairs<I>
fn filter_key_value_by_type(
    self,
    token_type: TokenType
) -> FilterTypedKeyValuePairs<Self> where
    Self: Sized

Returns an Iterator which filters key=value pairs, if value.kind matches the given token_type.

It is useful, for example, to get rid of null values on a lexical level.

Important traits for TokenReader<'a, I>
fn reader(self, source: Option<&str>) -> TokenReader<Self> where
    Self: Sized

Returns a TokenReader to produce a byte stream from Token instances

Arguments

  • source - an optional, original string from which the tokens were generated. This offers the best performance when serializing tokens, as they can refer to their original &str slice.
Loading content...

Implementors

impl<T: Iterator<Item = Token>> IteratorExt for T[src]

Loading content...