[−][src]Trait gobble::ptrait::Parser
The core trait for parsing
Required methods
Loading content...Provided methods
fn parse_s(&self, s: &str) -> Result<V, ParseError>
fn then<P: Parser<V2>, V2>(self, p: P) -> Then<Self, P>
returns a parser that will combine the results of this and the given parser into a tuple
fn then_ig<P: Parser<V2>, V2>(self, p: P) -> ThenIg<Self, P, V, V2>
returns a Parser that will require the given parser completes, but ignores its result useful for dropping brackets and whitespace
fn ig_then<P: Parser<V2>, V2>(self, p: P) -> IgThen<Self, P, V, V2>
returns a Parser that will require this parser completes, but only return the result of the given parser useful for dropping brackets and whitespace etc
fn or<P: Parser<V>>(self, p: P) -> Or<Self, P>
Returns a Parser that will try both child parsers, (A first) and return the first successfl result
fn map<F: Fn(V) -> V2, V2>(self, f: F) -> Map<Self, V, V2, F>
Returns a Parser that converts the result of a successful parse to a different type. Much like map on iterators and Result
fn try_map<F: Fn(V) -> Result<V2, ECode>, V2>(
self,
f: F
) -> TryMap<Self, V, V2, F>
self,
f: F
) -> TryMap<Self, V, V2, F>
Returns a Parser that converts the result of a successful parse to a different type. however the map function can fail and return a result The Error type should be err::ECode, this does not have line associated. That will be attacked by the TryMap object so this will pass that error up correctly
Implementors
impl Parser<&'static str> for Tag
[src]
impl Parser<String> for Escape
[src]
impl Parser<String> for TakeN
[src]
impl<A, B, AV, BV> Parser<(AV, BV)> for Then<A, B> where
A: Parser<AV>,
B: Parser<BV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
impl<A, B, AV, BV> Parser<Vec<AV>> for Separated<A, B, AV, BV> where
A: Parser<AV>,
B: Parser<BV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
impl<A, B, AV, BV> Parser<AV> for ThenIg<A, B, AV, BV> where
A: Parser<AV>,
B: Parser<BV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
impl<A, B, AV, BV> Parser<BV> for IgThen<A, B, AV, BV> where
A: Parser<AV>,
B: Parser<BV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
impl<A, B, C, AV, BV, CV> Parser<(Vec<AV>, BV, Vec<CV>)> for Reflect<A, B, C, AV, BV, CV> where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
impl<A, B, C, AV, BV, CV> Parser<Vec<AV>> for SepUntil<A, B, C, AV, BV, CV> where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
impl<A, B, V> Parser<V> for Or<A, B> where
A: Parser<V>,
B: Parser<V>,
[src]
A: Parser<V>,
B: Parser<V>,
impl<A, B, VA, VB> Parser<VB> for Wrap<A, B, VA, VB> where
A: Parser<VA>,
B: Parser<VB>,
[src]
A: Parser<VA>,
B: Parser<VB>,
impl<A, V> Parser<Option<V>> for Maybe<A> where
A: Parser<V>,
[src]
A: Parser<V>,
impl<A: Parser<AV>, AV> Parser<Vec<AV>> for RepeatN<A, AV>
[src]
impl<A: Parser<AV>, AV> Parser<Vec<AV>> for Repeater<A, AV>
[src]
impl<A: Parser<AV>, AV, B, F: Fn(AV) -> Result<B, ECode>> Parser<B> for TryMap<A, AV, B, F>
[src]
impl<A: Parser<AV>, AV, B, F: Fn(AV) -> B> Parser<B> for Map<A, AV, B, F>
[src]
impl<A: Parser<AV>, B: Parser<BV>, AV, BV> Parser<(Vec<AV>, BV)> for RepUntil<A, B, AV, BV>
[src]
impl<F> Parser<()> for Take<F> where
F: Fn(char) -> bool,
[src]
F: Fn(char) -> bool,
impl<F> Parser<()> for Skip<F> where
F: Fn(char) -> bool,
[src]
F: Fn(char) -> bool,
impl<F> Parser<String> for Read<F> where
F: Fn(String, char) -> ReadResult<String>,
[src]
F: Fn(String, char) -> ReadResult<String>,