nom_supreme::tag

Trait TagError

Source
pub trait TagError<I, T>: Sized {
    // Required method
    fn from_tag(input: I, tag: T) -> Self;

    // Provided method
    fn from_tag_no_case(input: I, tag: T) -> Self { ... }
}
Expand description

Similar to FromExternalError and ContextError, this trait allows a parser to create an error representing an unmatched tag. This allows error messages to produce more useful context about what went wrong.

Required Methods§

Source

fn from_tag(input: I, tag: T) -> Self

Create an error from an expected tag at a location.

Provided Methods§

Source

fn from_tag_no_case(input: I, tag: T) -> Self

As above, but for a case insensitive tag. By default this just calls from_tag

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.

Implementations on Foreign Types§

Source§

impl<I, T> TagError<I, T> for (I, ErrorKind)

Source§

fn from_tag(input: I, _tag: T) -> Self

Source§

impl<I, T> TagError<I, T> for ()

Source§

fn from_tag(_input: I, _tag: T)

Source§

impl<I, T> TagError<I, T> for Error<I>

Source§

fn from_tag(input: I, _tag: T) -> Self

Source§

impl<I, T> TagError<I, T> for VerboseError<I>

Source§

fn from_tag(input: I, _tag: T) -> Self

Implementors§

Source§

impl<I, T: AsRef<[u8]>, C, E> TagError<I, T> for GenericErrorTree<I, T, C, E>