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§
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>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".