Type Alias AstId

Source
pub type AstId<N> = InFile<FileAstId<N>>;
Expand description

AstId points to an AST node in any file.

It is stable across reparses, and can be used as salsa key/value.

Aliased Type§

pub struct AstId<N> {
    pub file_id: HirFileId,
    pub value: FileAstId<N>,
}

Fields§

§file_id: HirFileId§value: FileAstId<N>

Implementations§

Source§

impl<N: AstNode> AstId<N>

Source

pub fn to_node(&self, db: &dyn ExpandDatabase) -> N

Source

pub fn to_range(&self, db: &dyn ExpandDatabase) -> TextRange

Source

pub fn to_in_file_node(&self, db: &dyn ExpandDatabase) -> InFile<N>

Source

pub fn to_ptr(&self, db: &dyn ExpandDatabase) -> AstPtr<N>

Source

pub fn erase(&self) -> ErasedAstId

Source

pub fn upcast<M: AstIdNode>(self) -> AstId<M>
where N: Into<M>,