ResolvedTokenInfo

Struct ResolvedTokenInfo 

Source
pub struct ResolvedTokenInfo {
    pub channel: TokenChannel,
    pub token_type: TokenType,
    pub token_index: u32,
    pub start: u32,
    pub stop: u32,
    pub line: u32,
    pub column: u32,
    pub end_line: u32,
    pub end_column: u32,
    pub payload: Payload,
}
Expand description

A struct with all token information usable without the TokenizedBuffer

Fields§

§channel: TokenChannel

Channel of the token.

§token_type: TokenType

Type of the token.

§token_index: u32

Token index

§start: u32

Zero-based char index of the token start in the source string. Char here means a Unicode code point, not graphemes. This is what Python uses to index strings, and IDEs show for cursor position. u32 as we only support 4gb files

§stop: u32

Zero-based char index of the token end in the source string. Will point to the character immediately after the token. Char here means a Unicode code point, not graphemes. This is what Python uses to index strings, and IDEs show for cursor position. u32 as we only support 4gb files

§line: u32

Starting line of the token, 1-based.

§column: u32

Zero-based column of the token start on the start line.

§end_line: u32

Ending line of the token, 1-based.

§end_column: u32

Zero-based column of the token end on the end line. This is the column of the character immediately after the token.

§payload: Payload

Extra data associated with the token.

Note that the range in the string literal buffer that Payload::StringLiteral holds is a byte offset range, not a char offset range.

Trait Implementations§

Source§

impl Debug for ResolvedTokenInfo

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 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> 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, 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.