pub trait LiteralPrefix: Sized + 'static {
// Required methods
fn strip_literal<'i>(&self, input: &'i [u8]) -> Option<&'i [u8]>;
fn expected_one_of(literals: &'static [Self]) -> ParseError;
}Expand description
Helper trait for rule literals in parser::parse_tree! scopes.
Required Methods§
Sourcefn strip_literal<'i>(&self, input: &'i [u8]) -> Option<&'i [u8]>
fn strip_literal<'i>(&self, input: &'i [u8]) -> Option<&'i [u8]>
Returns the remaining input if the input starts with this literal.
Sourcefn expected_one_of(literals: &'static [Self]) -> ParseError
fn expected_one_of(literals: &'static [Self]) -> ParseError
Returns a ParseError containing the expected literals.
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.