[−][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 parse_sn<'a>(&self, s: &'a str) -> Result<(&'a str, 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
fn asv<R: Clone>(self, r: R) -> As<Self, V, R>
fn map_err<F: Fn(ECode) -> ECode>(self, f: F) -> MapErr<Self, V, F>
fn brk(self) -> Break<Self, V>
Implementations on Foreign Types
impl Parser<&'static str> for &'static str
[src]
impl Parser<char> for char
[src]
impl<A, AV, B, BV> Parser<(AV, BV)> for (A, B) where
A: Parser<AV>,
B: Parser<BV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
impl<A, AV, B, BV, C, CV> Parser<(AV, BV, CV)> for (A, B, C) where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
impl<A, AV, B, BV, C, CV, D, DV> Parser<(AV, BV, CV, DV)> for (A, B, C, D) where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
impl<A, AV, B, BV, C, CV, D, DV, E, EV> Parser<(AV, BV, CV, DV, EV)> for (A, B, C, D, E) where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
E: Parser<EV>,
[src]
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
E: Parser<EV>,
impl<A, AV, B, BV, C, CV, D, DV, E, EV, F, FV> Parser<(AV, BV, CV, DV, EV, FV)> for (A, B, C, D, E, F) where
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
E: Parser<EV>,
F: Parser<FV>,
[src]
Loading content...
A: Parser<AV>,
B: Parser<BV>,
C: Parser<CV>,
D: Parser<DV>,
E: Parser<EV>,
F: Parser<FV>,
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<String> for String2P<A, B, AV, BV> where
A: Parser<AV>,
B: Parser<BV>,
AV: Into<String>,
BV: AsRef<str>,
[src]
A: Parser<AV>,
B: Parser<BV>,
AV: Into<String>,
BV: AsRef<str>,
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<char>, B: Parser<BV>, BV> Parser<String> for CharsUntil<A, B, BV>
[src]
impl<A: Parser<AV>, AV> Parser<()> for SkipRepeat<A, AV>
[src]
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>, AV, R: Clone> Parser<R> for As<A, AV, R>
[src]
impl<A: Parser<AV>, AV: Into<String> + AsRef<str>> Parser<String> for StringRepeat<A, AV>
[src]
impl<A: Parser<AV>, B: Parser<BV>, AV, BV> Parser<(Vec<AV>, BV)> for RepUntil<A, B, AV, BV>
[src]
impl<CB: CharBool> Parser<char> for OneChar<CB>
[src]
impl<CB: CharBool> Parser<()> for Skip<CB>
[src]
impl<CB: CharBool> Parser<String> for Chars<CB>
[src]
impl<F> Parser<()> for Take<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>,