diff --git a/src/rcore/modes.rs b/src/rcore/modes.rs index a1cb1de..13b2a8f 100644 --- a/src/rcore/modes.rs +++ b/src/rcore/modes.rs @@ -34,11 +34,21 @@ pub trait Mode { /// See [`FactoryParse::extend`]. type ExtensionSource; + /// 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( s: Self::ParseSuccess, f: impl FnOnce(A0) -> Result, ) -> ModeResult; + /// Map the successfully parsed value. + /// + /// See also [`Mode::bind`] fn map( s: Self::ParseSuccess, f: impl FnOnce(A0) -> A1, diff --git a/src/rstd/cast.rs b/src/rstd/cast.rs index f044570..3c08f50 100644 --- a/src/rstd/cast.rs +++ b/src/rstd/cast.rs @@ -2,7 +2,7 @@ //! See [`TypelessMentionable::cast`]/[`Point::cast`]. //! //! p.s. the implementation is horrific. -//! +//! //! [`rcore`]: crate::rcore use std::convert::identity; diff --git a/src/rstd/typeless.rs b/src/rstd/typeless.rs index d37d518..d11b9c4 100644 --- a/src/rstd/typeless.rs +++ b/src/rstd/typeless.rs @@ -1,5 +1,5 @@ //! Previously part of [`rcore`]. -//! +//! //! [`rcore`]: crate::rcore use super::{cast::CastError, wrapped_origin::*, *};