Mode::bind
/Mode::map
docs
This commit is contained in:
parent
37a38f5c2a
commit
44c04431a8
@ -34,11 +34,21 @@ pub trait Mode {
|
||||
/// See [`FactoryParse::extend`].
|
||||
type ExtensionSource<A>;
|
||||
|
||||
/// Do something with the successfully parsed value, potentially failing.
|
||||
///
|
||||
/// Useful for chaining parsing after [`InliningFactory`].
|
||||
///
|
||||
/// See also [`Mode::map`]
|
||||
///
|
||||
/// [`InliningFactory`]: crate::rstd::inlining::InliningFactory
|
||||
fn bind<A0, A1, E, I>(
|
||||
s: Self::ParseSuccess<A0, I>,
|
||||
f: impl FnOnce(A0) -> Result<A1, E>,
|
||||
) -> ModeResult<Self, A1, E, I>;
|
||||
|
||||
/// Map the successfully parsed value.
|
||||
///
|
||||
/// See also [`Mode::bind`]
|
||||
fn map<A0, A1, I>(
|
||||
s: Self::ParseSuccess<A0, I>,
|
||||
f: impl FnOnce(A0) -> A1,
|
||||
|
Loading…
Reference in New Issue
Block a user