Enum LexerToken

Source
#[repr(usize)]
pub enum LexerToken {
Show 25 variants Mark = 0, NewLine = 4_294_967_263, ErrorToken = 4_294_967_273, DirectiveTag = 4_294_967_275, DirectiveReserved = 4_294_967_276, DirectiveYaml = 4_294_967_274, ScalarPlain = 4_294_967_285, ScalarEnd = 4_294_967_280, ScalarFold = 4_294_967_284, ScalarLit = 4_294_967_283, ScalarSingleQuote = 4_294_967_282, ScalarDoubleQuote = 4_294_967_281, AnchorToken = 4_294_967_278, AliasToken = 4_294_967_277, TagStart = 4_294_967_279, SequenceStart = 4_294_967_287, SequenceStartImplicit = 4_294_967_286, SequenceEnd = 4_294_967_288, MappingStart = 4_294_967_290, MappingStartImplicit = 4_294_967_289, MappingEnd = 4_294_967_291, DocumentStart = 4_294_967_293, DocumentStartExplicit = 4_294_967_292, DocumentEnd = 4_294_967_295, DocumentEndExplicit = 4_294_967_294,
}
Expand description

LexerToken used to Lex YAML files

Variants§

§

Mark = 0

Denotes that value is a usize less than NewLine and thus its meaning decided by previous Tokens usually marks a start/end token.

§

NewLine = 4_294_967_263

Denotes a newline and must be followed by a Mark. If next Mark is 0, it’s space otherwise it’s a n number of newlines \n

§

ErrorToken = 4_294_967_273

Error in stream, check [Lexer.errors] for details

§

DirectiveTag = 4_294_967_275

Directive Tag denoted by %TAG and followed by two Mark tokens

§

DirectiveReserved = 4_294_967_276

Directive Tag denoted by @value and followed by two Mark tokens

§

DirectiveYaml = 4_294_967_274

YAML directive showing minor/major version of e.g.

    %YAML 1.2
§

ScalarPlain = 4_294_967_285

Plain Scalar that’s neither quoted or literal or folded

    example: plain_scalar
§

ScalarEnd = 4_294_967_280

Helper token to end token

§

ScalarFold = 4_294_967_284

Folded scalar token

    example: >
        folded_scalar
§

ScalarLit = 4_294_967_283

Literal scalar token

    example: |
        literal_scalar
§

ScalarSingleQuote = 4_294_967_282

Single quoted scalar

    example: 'single quote scalar'
§

ScalarDoubleQuote = 4_294_967_281

Double quoted scalar

    example: "double quote scalar"
§

AnchorToken = 4_294_967_278

Element with alternative name e.g. &foo [x,y]

§

AliasToken = 4_294_967_277

Reference to an element with alternative name e.g. *foo

§

TagStart = 4_294_967_279

Tag

§

SequenceStart = 4_294_967_287

Start of a sequence token, e.g. [ in

 [a, b, c]
#^-- start of sequence
§

SequenceStartImplicit = 4_294_967_286

Start of a sequence token, e.g. [ in

 [a, b, c]
#^-- start of sequence
§

SequenceEnd = 4_294_967_288

End of a sequence token, e.g. ] in

 [a, b, c]
#        ^-- end of sequence
§

MappingStart = 4_294_967_290

Start of a map token, e.g. { in

 { a: b,}
#^-- start of mapping
§

MappingStartImplicit = 4_294_967_289

Start of a map token, e.g. { in

  [a]: 3
#^-- start of mapping
§

MappingEnd = 4_294_967_291

End of a map token, e.g. } in

 { a: b}
#      ^-- start of mapping
§

DocumentStart = 4_294_967_293

Start of implicit Document

§

DocumentStartExplicit = 4_294_967_292

Start of explicit Document

§

DocumentEnd = 4_294_967_295

End of implicit document.

§

DocumentEndExplicit = 4_294_967_294

End of explicit document.

Trait Implementations§

Source§

impl Clone for LexerToken

Source§

fn clone(&self) -> LexerToken

Returns a duplicate 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 From<&usize> for LexerToken

Source§

fn from(value: &usize) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for LexerToken

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for LexerToken

Source§

fn eq(&self, other: &LexerToken) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for LexerToken

Source§

impl Eq for LexerToken

Source§

impl StructuralPartialEq for LexerToken

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.