Skip to main content

HasSource

Trait HasSource 

Source
pub trait HasSource {
    type Value: AstNode;

    // Required method
    fn ast_ptr(&self, db: &dyn SourceDatabase) -> InFile<AstPtr<Self::Value>>;

    // Provided method
    fn source(&self, db: &dyn SourceDatabase) -> InFile<Self::Value> { ... }
}

Required Associated Types§

Source

type Value: AstNode

Required Methods§

Source

fn ast_ptr(&self, db: &dyn SourceDatabase) -> InFile<AstPtr<Self::Value>>

Provided Methods§

Source

fn source(&self, db: &dyn SourceDatabase) -> InFile<Self::Value>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> HasSource for T
where T: AstIdLoc,

Source§

type Value = <T as AstIdLoc>::Ast