Skip to main content

SemanticTokenObject

Trait SemanticTokenObject 

Source
pub trait SemanticTokenObject {
    type Context;

    // Required method
    fn to_tokens_in(
        &self,
        ctx: &Self::Context,
        tokens: &mut Vec<SemanticToken<'_>>,
    );

    // Provided methods
    fn to_tokens(&self, ctx: &Self::Context) -> Vec<SemanticToken<'_>> { ... }
    fn to_respanned_tokens<'src>(
        &self,
        source: &'src str,
        object_span: Span,
        ctx: &Self::Context,
    ) -> Vec<Spanned<SemanticToken<'src>>> { ... }
}
Expand description

An object that can be turned into semantic tokens

Required Associated Types§

Required Methods§

Source

fn to_tokens_in(&self, ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>)

Provided Methods§

Source

fn to_tokens(&self, ctx: &Self::Context) -> Vec<SemanticToken<'_>>

Source

fn to_respanned_tokens<'src>( &self, source: &'src str, object_span: Span, ctx: &Self::Context, ) -> Vec<Spanned<SemanticToken<'src>>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SemanticTokenObject for Access

Source§

type Context = ()

Source§

fn to_tokens_in( &self, _ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>, )

Source§

impl SemanticTokenObject for AddressMode

Source§

type Context = ()

Source§

fn to_tokens_in( &self, _ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>, )

Source§

impl SemanticTokenObject for BaseType

Source§

type Context = ()

Source§

fn to_tokens_in( &self, _ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>, )

Source§

impl SemanticTokenObject for ByteOrder

Source§

type Context = ()

Source§

fn to_tokens_in( &self, _ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>, )

Source§

impl SemanticTokenObject for Integer

Source§

type Context = ()

Source§

fn to_tokens_in( &self, _ctx: &Self::Context, tokens: &mut Vec<SemanticToken<'_>>, )

Implementors§