pub trait Inpt<'s>: Sized + 's {
// Required method
fn step(
text: &'s str,
end: bool,
trimmed: CharClass,
guard: &mut RecursionGuard,
) -> InptStep<'s, Self>;
// Provided method
fn default_trim(inherited: CharClass) -> CharClass { ... }
}Expand description
The core parsing trait.
Although this can be implemented manually without too much work, it is best to derive it as described in the top-level documentation.
Required Methods§
Sourcefn step(
text: &'s str,
end: bool,
trimmed: CharClass,
guard: &mut RecursionGuard,
) -> InptStep<'s, Self>
fn step( text: &'s str, end: bool, trimmed: CharClass, guard: &mut RecursionGuard, ) -> InptStep<'s, Self>
Consume a token of this type from the given text if possible, returning an error if not.
If end is false, all remaining text should also be returned. Otherwise the text should be
consumed entirely. All text must be trimmed with the given CharClass (typically but not
always returned from Inpt::default_trim) before being passed to this function.
Consider deriving Inpt or calling crate::inpt() instead of using this directly.
Provided Methods§
Sourcefn default_trim(inherited: CharClass) -> CharClass
fn default_trim(inherited: CharClass) -> CharClass
Determine the class of characters which this type would like trimmed off of any text before parsing. This is inherited from the parent type if not otherwise defined.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.