TreeToken

Trait TreeToken 

Source
pub trait TreeToken:
    Clone
    + Debug
    + PartialEq
    + Eq
    + Hash {
    type Node: TreeNode;

    // Required methods
    fn parent(&self) -> Self::Node;
    fn kind(&self) -> SyntaxKind;
    fn text(&self) -> &str;
    fn span(&self) -> Span;
}
Expand description

A trait that abstracts the underlying representation of a syntax token.

Required Associated Types§

Source

type Node: TreeNode

The associated node type for the token.

Required Methods§

Source

fn parent(&self) -> Self::Node

Gets the parent node of the token.

Source

fn kind(&self) -> SyntaxKind

Gets the syntax kind for the token.

Source

fn text(&self) -> &str

Gets the text of the token.

Source

fn span(&self) -> Span

Gets the span of the token.

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§