Mode table

This commit is contained in:
AF 2023-07-30 11:07:45 +00:00
parent 8ef8aaf156
commit a881a77dd3

View File

@ -6,10 +6,18 @@ use super::*;
pub type ModeResult<M, A, E, I> = Result<<M as Mode>::ParseSuccess<A, I>, E>;
/// Mode of parsing.
///
/// | [`Mode`] | [`Mode::ParseSuccess<A, I>`] | [`Mode::ExtensionResult<A, E>`] | [`Mode::ExtensionSource<A>`] |
/// |------------------|------------------------------|---------------------------------|------------------------------|
/// | [`RegularMode`] | `A` | [`Result<A, E>`] | `A` |
/// | [`InliningMode`] | `(A, I)` | `E` | [`()`] |
///
/// [`InliningMode`]: crate::rstd::inlining::InliningMode
/// [`()`]: unit
pub trait Mode {
/// Successful parsing, may countain the parser itself
/// (`I`, usually [`Inlining`]).
///
///
/// See [`FactoryParse::deserialize`].
type ParseSuccess<A, I>;
@ -19,7 +27,7 @@ pub trait Mode {
type ExtensionResult<A, E>;
/// Data enough to try extending the value.
///
///
/// May be empty for always-failing extensions.
///
/// See [`FactoryParse::extend`].