pub enum ParseAction {
    MatchedNone,
    MatchedPart(usize),
    MatchedToken {
        token: Token,
        len: usize,
    },
    Skip(usize),
    Escape {
        len_seq: usize,
        n_skip: usize,
    },
}
Expand description

The result of a call to TengwarMode::process. This specifies the next action that will be taken by a Tokenizer.

Variants§

§

MatchedNone

Nothing could be done with the input.

§

MatchedPart(usize)

A portion of the input was processed successfully, but more is needed.

§

MatchedToken

Fields

§token: Token

The completed Token.

§len: usize

The number of chars that were processed during the final step of parsing this Token.

A complete Token has been processed.

§

Skip(usize)

A portion of the input has been determined to be irrelevant to the processing. The contained number of chars should be passed through unchanged.

§

Escape

Fields

§len_seq: usize

The number of chars in the escape sequence itself. These will be ignored, and will not be present in the output in any way.

§n_skip: usize

The number of chars affected by the escape sequence. These will be passed through to the output without being processed.

An escape sequence has been found. The next char will be ignored, and the one following will be passed through unchanged.

Implementations§

source§

impl ParseAction

source

pub const ESC_BACKSLASH: Self = _

The behavior of a simple backslash escape sequence.

source

pub const fn matched_opt(token: Option<Token>, len: usize) -> Self

Trait Implementations§

source§

impl Clone for ParseAction

source§

fn clone(&self) -> ParseAction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParseAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.