pub trait ParserExt<I: Input>: Parser<I> + Sized {
Show 26 methods
// Provided methods
fn map<F, O2>(self, f: F) -> Map<Self, F>
where F: FnMut(Self::Output) -> O2 { ... }
fn zip<P2>(self, rhs: P2) -> Zip<Self, P2>
where P2: Parser<I, Error = Self::Error> { ... }
fn zip_left<P2>(self, rhs: P2) -> ZipLeft<Self, P2>
where P2: Parser<I, Error = Self::Error> { ... }
fn zip_right<P2>(self, rhs: P2) -> ZipRight<Self, P2>
where P2: Parser<I, Error = Self::Error> { ... }
fn or<P2>(self, rhs: P2) -> Or<Self, P2>
where Self::Error: MergeError,
P2: Parser<I, Output = Self::Output, Error = Self::Error> { ... }
fn attempt(self) -> Attempt<Self> { ... }
fn cut(self) -> Cut<Self> { ... }
fn optional(self) -> Optional<Self> { ... }
fn many0(self) -> Many<Self> { ... }
fn many1(self) -> Many1<Self> { ... }
fn many0_fold<B, F, Acc>(self, init: B, f: F) -> ManyFold<Self, B, F>
where B: FnMut() -> Acc,
F: FnMut(Acc, Self::Output) -> Acc { ... }
fn many1_fold<B, F, Acc>(self, init: B, f: F) -> Many1Fold<Self, B, F>
where B: FnMut() -> Acc,
F: FnMut(Acc, Self::Output) -> Acc { ... }
fn many0_into<C>(
self,
container: C,
) -> ManyFold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
where C: Extend<Self::Output> + Clone { ... }
fn many1_into<C>(
self,
container: C,
) -> Many1Fold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
where C: Extend<Self::Output> + Clone { ... }
fn context(self, label: &'static str) -> Context<Self>
where Self::Error: ContextError { ... }
fn sep_by0<S>(self, sep: S) -> SepBy0<Self, S>
where S: Parser<I, Error = Self::Error> { ... }
fn sep_by1<S>(self, sep: S) -> SepBy1<Self, S>
where S: Parser<I, Error = Self::Error> { ... }
fn sep_by0_fold<S, B, F, Acc>(
self,
sep: S,
init: B,
f: F,
) -> SepByFold0<Self, S, B, F>
where S: Parser<I, Error = Self::Error>,
B: FnMut() -> Acc,
F: FnMut(Acc, Self::Output) -> Acc { ... }
fn sep_by1_fold<S, B, F, Acc>(
self,
sep: S,
init: B,
f: F,
) -> SepByFold1<Self, S, B, F>
where S: Parser<I, Error = Self::Error>,
B: FnMut() -> Acc,
F: FnMut(Acc, Self::Output) -> Acc { ... }
fn sep_by0_into<S, C>(
self,
sep: S,
container: C,
) -> SepByFold0<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
where S: Parser<I, Error = Self::Error>,
C: Extend<Self::Output> + Clone { ... }
fn sep_by1_into<S, C>(
self,
sep: S,
container: C,
) -> SepByFold1<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
where S: Parser<I, Error = Self::Error>,
C: Extend<Self::Output> + Clone { ... }
fn chainl1<Op, F>(self, op: Op) -> ChainL1<Self, Op>
where Op: Parser<I, Output = F, Error = Self::Error>,
F: FnMut(Self::Output, Self::Output) -> Self::Output { ... }
fn chainr1<Op, F>(self, op: Op) -> ChainR1<Self, Op>
where Op: Parser<I, Output = F, Error = Self::Error>,
F: FnMut(Self::Output, Self::Output) -> Self::Output { ... }
fn map_res<F, O2, E2>(self, f: F, label: &'static str) -> MapRes<Self, F>
where Self: Parser<I, Error = ParseError>,
F: FnMut(Self::Output) -> Result<O2, E2> { ... }
fn flat_map<F, P2>(self, f: F) -> FlatMap<Self, F>
where P2: Parser<I, Error = Self::Error>,
F: FnMut(Self::Output) -> P2 { ... }
fn and_then<F, P2>(self, f: F) -> FlatMap<Self, F>
where P2: Parser<I, Error = Self::Error>,
F: FnMut(Self::Output) -> P2 { ... }
}Provided Methods§
fn map<F, O2>(self, f: F) -> Map<Self, F>
fn zip<P2>(self, rhs: P2) -> Zip<Self, P2>
fn or<P2>(self, rhs: P2) -> Or<Self, P2>
fn attempt(self) -> Attempt<Self>
fn cut(self) -> Cut<Self>
fn optional(self) -> Optional<Self>
fn many0(self) -> Many<Self>
fn many1(self) -> Many1<Self>
Sourcefn many0_fold<B, F, Acc>(self, init: B, f: F) -> ManyFold<Self, B, F>
fn many0_fold<B, F, Acc>(self, init: B, f: F) -> ManyFold<Self, B, F>
ゼロ個以上の要素を畳み込む(ゼロアロケーション)。
Sourcefn many1_fold<B, F, Acc>(self, init: B, f: F) -> Many1Fold<Self, B, F>
fn many1_fold<B, F, Acc>(self, init: B, f: F) -> Many1Fold<Self, B, F>
1個以上の要素を畳み込む(ゼロアロケーション)。
Sourcefn many0_into<C>(
self,
container: C,
) -> ManyFold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
fn many0_into<C>( self, container: C, ) -> ManyFold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
ゼロ個以上の要素をユーザー指定のコンテナに収集する。
Sourcefn many1_into<C>(
self,
container: C,
) -> Many1Fold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
fn many1_into<C>( self, container: C, ) -> Many1Fold<Self, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
1個以上の要素をユーザー指定のコンテナに収集する。
Sourcefn context(self, label: &'static str) -> Context<Self>where
Self::Error: ContextError,
fn context(self, label: &'static str) -> Context<Self>where
Self::Error: ContextError,
エラーにコンテキストラベルを付与する。
Sourcefn sep_by0_fold<S, B, F, Acc>(
self,
sep: S,
init: B,
f: F,
) -> SepByFold0<Self, S, B, F>
fn sep_by0_fold<S, B, F, Acc>( self, sep: S, init: B, f: F, ) -> SepByFold0<Self, S, B, F>
区切り付き 0 個以上の要素を畳み込む(ゼロアロケーション)。
Sourcefn sep_by1_fold<S, B, F, Acc>(
self,
sep: S,
init: B,
f: F,
) -> SepByFold1<Self, S, B, F>
fn sep_by1_fold<S, B, F, Acc>( self, sep: S, init: B, f: F, ) -> SepByFold1<Self, S, B, F>
区切り付き 1 個以上の要素を畳み込む(ゼロアロケーション)。
Sourcefn sep_by0_into<S, C>(
self,
sep: S,
container: C,
) -> SepByFold0<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
fn sep_by0_into<S, C>( self, sep: S, container: C, ) -> SepByFold0<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
区切り付き 0 個以上の要素をユーザー指定のコンテナに収集する。
Sourcefn sep_by1_into<S, C>(
self,
sep: S,
container: C,
) -> SepByFold1<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
fn sep_by1_into<S, C>( self, sep: S, container: C, ) -> SepByFold1<Self, S, impl FnMut() -> C, impl FnMut(C, Self::Output) -> C>
区切り付き 1 個以上の要素をユーザー指定のコンテナに収集する。
Sourcefn chainl1<Op, F>(self, op: Op) -> ChainL1<Self, Op>
fn chainl1<Op, F>(self, op: Op) -> ChainL1<Self, Op>
左結合の二項演算子チェーン。operand (op operand)* を左から畳む。
Sourcefn chainr1<Op, F>(self, op: Op) -> ChainR1<Self, Op>
fn chainr1<Op, F>(self, op: Op) -> ChainR1<Self, Op>
右結合の二項演算子チェーン。operand (op operand)* を右から畳む。
Sourcefn map_res<F, O2, E2>(self, f: F, label: &'static str) -> MapRes<Self, F>
fn map_res<F, O2, E2>(self, f: F, label: &'static str) -> MapRes<Self, F>
パーサーの結果を失敗しうる関数で変換する。
関数が Err を返した場合、Backtrack エラーになる。
入力は巻き戻さない(巻き戻したい場合は .attempt() と組み合わせる)。
fn flat_map<F, P2>(self, f: F) -> FlatMap<Self, F>
fn and_then<F, P2>(self, f: F) -> FlatMap<Self, F>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.