Skip to main content

Symbol

Trait Symbol 

Source
pub trait Symbol<'db>: Copy {
    type Output;

    // Required method
    fn symbol(self, db: &'db dyn Db) -> Self::Output;
}
Expand description

Return the symbol corresponding to the AST node. Implementations are memoized so that this can be called many times and will always yield the same symbol.

Required Associated Types§

Required Methods§

Source

fn symbol(self, db: &'db dyn Db) -> Self::Output

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.

Implementations on Foreign Types§

Source§

impl<'db> Symbol<'db> for AstFunctionInput<'db>

Source§

type Output = SymVariable<'db>

Source§

fn symbol(self, db: &'db dyn Db) -> SymVariable<'db>

Source§

impl<'db> Symbol<'db> for AstGenericKind<'db>

Convert to SymGenericKind

Source§

type Output = SymGenericKind

Source§

fn symbol(self, _db: &'db dyn Db) -> Self::Output

Source§

impl<'db> Symbol<'db> for AstSelfArg<'db>

Source§

type Output = SymVariable<'db>

Source§

fn symbol(self: AstSelfArg<'db>, db: &'db dyn Db) -> SymVariable<'db>

Source§

impl<'db> Symbol<'db> for VariableDecl<'db>

Source§

type Output = SymVariable<'db>

Source§

fn symbol(self: VariableDecl<'db>, db: &'db dyn Db) -> SymVariable<'db>

Source§

impl<'db> Symbol<'db> for AstModule<'db>

Source§

type Output = SymModule<'db>

Source§

fn symbol(self: AstModule<'db>, db: &'db dyn Db) -> SymModule<'db>

Source§

impl<'db> Symbol<'db> for AstGenericDecl<'db>

Create the symbol for an explicictly declared generic parameter. This is tracked so that we do it at most once.

Source§

type Output = SymVariable<'db>

Source§

fn symbol(self: AstGenericDecl<'db>, db: &'db dyn Db) -> SymVariable<'db>

Source§

impl<'db> Symbol<'db> for SourceFile

Source§

type Output = SymModule<'db>

Source§

fn symbol(self, db: &'db dyn Db) -> Self::Output

Implementors§