pub struct Parse;Expand description
Parser mode that extracts output or an error from the parser’s input
Trait Implementations§
Source§impl Mode for Parse
impl Mode for Parse
Source§type OutputForm<O> = O
type OutputForm<O> = O
The representational form of a successful parser application in this mode
Source§type MessageContainer<M> = ()
type MessageContainer<M> = ()
The representational form of stored messages used by this mode
Source§fn apply_parser<'a, O, E, M, I, P>(
parser: &P,
input: &'a I,
) -> ModeResult<O, E, M, Parse>
fn apply_parser<'a, O, E, M, I, P>( parser: &P, input: &'a I, ) -> ModeResult<O, E, M, Parse>
Applies a parser using this
ModeSource§fn convert_output<O>(output: impl Into<O>) -> O
fn convert_output<O>(output: impl Into<O>) -> O
Converts an output to its representational form in this mode
Source§fn convert_error<E>(error: impl Into<E>) -> E
fn convert_error<E>(error: impl Into<E>) -> E
Converts an error to its representational form in this mode
Source§fn merge_outputs<OA1, OA2, OB>(
output_1: OA1,
output_2: OA2,
function: impl Fn(OA1, OA2) -> OB,
) -> OB
fn merge_outputs<OA1, OA2, OB>( output_1: OA1, output_2: OA2, function: impl Fn(OA1, OA2) -> OB, ) -> OB
Merges two output types into one using a function
Source§fn merge_errors<EA1, EA2, EB>(
error_1: EA1,
error_2: EA2,
function: impl Fn(EA1, EA2) -> EB,
) -> EB
fn merge_errors<EA1, EA2, EB>( error_1: EA1, error_2: EA2, function: impl Fn(EA1, EA2) -> EB, ) -> EB
Merges two error types into one using a function
Source§fn map_output<OA, OB, E, M>(
result: ModeResult<OA, E, M, Parse>,
function: impl Fn(OA) -> OB,
) -> ModeResult<OB, E, M, Parse>
fn map_output<OA, OB, E, M>( result: ModeResult<OA, E, M, Parse>, function: impl Fn(OA) -> OB, ) -> ModeResult<OB, E, M, Parse>
Maps a result’s output type to another type in this mode
Source§fn map_error<O, EA, EB, M>(
result: ModeResult<O, EA, M, Parse>,
function: impl Fn(EA) -> EB,
) -> ModeResult<O, EB, M, Parse>
fn map_error<O, EA, EB, M>( result: ModeResult<O, EA, M, Parse>, function: impl Fn(EA) -> EB, ) -> ModeResult<O, EB, M, Parse>
Maps a result’s error type to another type in this mode
Source§fn map_messages<O, E, MA, MB>(
result: ModeResult<O, E, MA, Parse>,
_: impl Fn(MA) -> MB,
) -> ModeResult<O, E, MB, Parse>
fn map_messages<O, E, MA, MB>( result: ModeResult<O, E, MA, Parse>, _: impl Fn(MA) -> MB, ) -> ModeResult<O, E, MB, Parse>
Maps a result’s message type to another type in this mode
Source§fn new_message_container<M>()
fn new_message_container<M>()
Create a new empty
Self::MessageContainerSource§fn add_message_to_container<M>(
_: &mut <Parse as Mode>::MessageContainer<M>,
_: M,
)
fn add_message_to_container<M>( _: &mut <Parse as Mode>::MessageContainer<M>, _: M, )
Adds a message to a
Self::MessageContainerAuto Trait Implementations§
impl Freeze for Parse
impl RefUnwindSafe for Parse
impl Send for Parse
impl Sync for Parse
impl Unpin for Parse
impl UnwindSafe for Parse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more