Visitor

Trait Visitor 

Source
pub trait Visitor<'a, T>: Sized {
    // Required method
    fn accept(scanner: &mut Scanner<'a, T>) -> ParseResult<Self>;
}
Expand description

A Visitor is a trait that allows to define how to visit a Scanner.

When a Visitor is used on a Scanner, it will consume the input from the scanner and return the result of the visit.

§Type Parameters

  • T - The type of the data to visit.

§Associated Functions

  • accept - Try to accept the Scanner and return the result of the visit.

Required Methods§

Source

fn accept(scanner: &mut Scanner<'a, T>) -> ParseResult<Self>

Try to accept the Scanner and return the result of the visit.

§Arguments
  • scanner - The scanner to accept.
§Returns

The result of the visit.

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.

Implementors§

Source§

impl Visitor<'_, u8> for Number<i8>

Source§

impl Visitor<'_, u8> for Number<i16>

Source§

impl Visitor<'_, u8> for Number<i32>

Source§

impl Visitor<'_, u8> for Number<i64>

Source§

impl Visitor<'_, u8> for Number<i128>

Source§

impl Visitor<'_, u8> for Number<isize>

Source§

impl Visitor<'_, u8> for Number<u8>

Source§

impl Visitor<'_, u8> for Number<u16>

Source§

impl Visitor<'_, u8> for Number<u32>

Source§

impl Visitor<'_, u8> for Number<u64>

Source§

impl Visitor<'_, u8> for Number<u128>

Source§

impl Visitor<'_, u8> for Number<usize>

Source§

impl<'a> Visitor<'a, u8> for BinaryOperator

Source§

impl<'a> Visitor<'a, u8> for DataString<&'a str>

Source§

impl<'a> Visitor<'a, u8> for DataString<Cow<'a, str>>

Source§

impl<'a> Visitor<'a, u8> for DataString<String>

Source§

impl<'a> Visitor<'a, u8> for OptionalWhitespaces

Source§

impl<'a> Visitor<'a, u8> for Whitespaces

Source§

impl<'a, T, V, S> Visitor<'a, T> for SeparatedList<T, V, S>
where V: Visitor<'a, T>, S: Visitor<'a, T>,