Trait parsed::matcher::Matcher[][src]

pub trait Matcher<T> {
    fn do_match(&self, bs: &mut ByteStream) -> Result<T, MatchError>;

    fn boxed(self) -> Box<dyn Matcher<T>>
    where
        Self: Sized + 'static
, { ... }
fn then<U, That>(self, that: That) -> Chain<Self, That>
    where
        Self: Sized,
        That: Matcher<U>
, { ... }
fn then_with<U, F, N>(self, f: F) -> Expose<Self, F>
    where
        Self: Sized,
        F: Fn(&T) -> N + 'static,
        N: Matcher<U>
, { ... }
fn map<U, F>(self, f: F) -> Map<Self, T, F>
    where
        Self: Sized,
        F: Fn(T) -> U + 'static
, { ... }
fn then_map<U, That, F, V>(
        self,
        that: That,
        f: F
    ) -> Map<Chain<Self, That>, (T, U), F>
    where
        Self: Sized,
        That: Matcher<U>,
        F: Fn((T, U)) -> V + 'static
, { ... } }

Required methods

fn do_match(&self, bs: &mut ByteStream) -> Result<T, MatchError>[src]

Loading content...

Provided methods

fn boxed(self) -> Box<dyn Matcher<T>> where
    Self: Sized + 'static, 
[src]

fn then<U, That>(self, that: That) -> Chain<Self, That> where
    Self: Sized,
    That: Matcher<U>, 
[src]

fn then_with<U, F, N>(self, f: F) -> Expose<Self, F> where
    Self: Sized,
    F: Fn(&T) -> N + 'static,
    N: Matcher<U>, 
[src]

fn map<U, F>(self, f: F) -> Map<Self, T, F> where
    Self: Sized,
    F: Fn(T) -> U + 'static, 
[src]

fn then_map<U, That, F, V>(
    self,
    that: That,
    f: F
) -> Map<Chain<Self, That>, (T, U), F> where
    Self: Sized,
    That: Matcher<U>,
    F: Fn((T, U)) -> V + 'static, 
[src]

Loading content...

Implementations on Foreign Types

impl<T> Matcher<T> for Box<dyn Matcher<T>>[src]

Loading content...

Implementors

impl<M, F, N, T, U> Matcher<(T, U)> for Expose<M, F> where
    M: Matcher<T>,
    F: Fn(&T) -> N + 'static,
    N: Matcher<U>, 
[src]

impl<M, N, T, U> Matcher<(T, U)> for Chain<M, N> where
    M: Matcher<T>,
    N: Matcher<U>, 
[src]

impl<M, T, U> Matcher<T> for Skip<M, T, U> where
    M: Matcher<(T, U)>, 
[src]

impl<M, T, U, F> Matcher<T> for Save<M, T, U, F> where
    M: Matcher<(T, U)>,
    F: Fn(&mut T, U), 
[src]

impl<M, T, U, F> Matcher<U> for Map<M, T, F> where
    M: Matcher<T>,
    F: Fn(T) -> U + 'static, 
[src]

impl<T, F> Matcher<T> for F where
    F: Fn(&mut ByteStream) -> Result<T, MatchError>, 
[src]

Loading content...