TokenWithSpan in sqlparser::tokenizer - Rust

Struct TokenWithSpan 

Source

pub struct TokenWithSpan {
    pub token: Token,
    pub span: Span,
}
Expand description

A Token with Span attached to it

This is used to track the location of a token in the input string

§Examples

// commas @ line 1, column 10
let tok1 = TokenWithSpan::new(
  Token::Comma,
  Span::new(Location::new(1, 10), Location::new(1, 11)),
);
assert_eq!(tok1, Token::Comma); // can compare the token

// commas @ line 2, column 20
let tok2 = TokenWithSpan::new(
  Token::Comma,
  Span::new(Location::new(2, 20), Location::new(2, 21)),
);
// same token but different locations are not equal
assert_ne!(tok1, tok2);

A Token together with its Span (location in the source).

The token value.

The span covering the token in the input.

Source§
Source§
Source§
Source§
Source§
Source§

Converts to this type from the input type.

Source§
Source§

Converts to this type from the input type.

Source§
Source§
Source§
Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

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

Source§
Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

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

Source§
Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

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

Source§
Source§

This method returns an ordering between self and other values if one exists. Read more

1.0.0 · Source§

Tests less than (for self and other) and is used by the < operator. Read more

1.0.0 · Source§

Tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0 · Source§

Tests greater than (for self and other) and is used by the > operator. Read more

1.0.0 · Source§

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Source§
Source§
Source§

Return the Span (the minimum and maximum Location) for this AST node, by recursively combining the spans of its children.

Source§
Source§
Source§
Source§

§
§
§
§
§
§