pub trait AlwaysTool<'a>: Tool<'a> {
// Required method
fn parse_always(&self, st: View<'a>) -> (Self::Data, usize, View<'a>);
// Provided method
fn parse_always_nodata(&self, st: View<'a>) -> ((), usize, View<'a>) { ... }
}Expand description
A parsing tool that always match a prefix.
Any object implementing this trait must also implement the Tool trait and their
implementation of the parse must be equivalent to
Ok(self.parse_always(st)).
It is a good practice to set core::convert::Infallible (or ! when it will become
stable) as Error, but it is not mandatory.
Required Methods§
Provided Methods§
Implementations on Foreign Types§
Source§impl<'a, T> AlwaysTool<'a> for &Twhere
T: AlwaysTool<'a> + ?Sized,
impl<'a, T> AlwaysTool<'a> for &Twhere
T: AlwaysTool<'a> + ?Sized,
Implementors§
impl<'a> AlwaysTool<'a> for WhiteSP
impl<'a> AlwaysTool<'a> for TrueTool
impl<'a, F, S> AlwaysTool<'a> for Or<F, S>where
F: AlwaysTool<'a>,
S: Tool<'a>,
impl<'a, F, S> AlwaysTool<'a> for Seq<F, S>where
F: AlwaysTool<'a>,
S: AlwaysTool<'a>,
impl<'a, T, D, E, FD, FE> AlwaysTool<'a> for MapTool<T, FD, FE>
impl<'a, T, E> AlwaysTool<'a> for SetError<T, E>where
T: AlwaysTool<'a>,
impl<'a, T, SEP> AlwaysTool<'a> for RepeatAny<T, SEP>
impl<'a, T, SEP> AlwaysTool<'a> for VecStore<RepeatAny<T, SEP>>
Available on crate feature
alloc only.