Struct ra_ap_ide_db::RootDatabase [−][src]
pub struct RootDatabase { /* fields omitted */ }
Implementations
Trait Implementations
fn salsa_event(&self, event_fn: Event)
fn salsa_event(&self, event_fn: Event)
This function is invoked at key points in the salsa runtime. It permits the database to be customized and to inject logging or other custom behavior. Read more
fn unwind_if_cancelled(&self)
fn unwind_if_cancelled(&self)
Starts unwinding the stack if the current revision is cancelled. Read more
fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime. Read more
fn salsa_runtime_mut(&mut self) -> &mut Runtime
fn salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime. Read more
Upcast this type to a dyn Database
.
Gives access to the underlying salsa runtime.
Gives access to the underlying salsa runtime.
Formats a database key index in a human readable fashion.
True if the computed value for input
may have changed since revision
.
Executes the callback for each kind of query.
type DatabaseStorage = __SalsaDatabaseStorage
type DatabaseStorage = __SalsaDatabaseStorage
Defines the “storage type”, where all the query data is kept.
This type is defined by the database_storage
macro. Read more
Returns the “default value” for a type. Read more
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Access the group storage struct from the database.
Auto Trait Implementations
impl RefUnwindSafe for RootDatabase
impl Send for RootDatabase
impl !Sync for RootDatabase
impl Unpin for RootDatabase
impl UnwindSafe for RootDatabase
Blanket Implementations
impl<DB> AstDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<AstDatabaseStorage>,
impl<DB> AstDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<AstDatabaseStorage>,
pub fn ast_id_map(&self, file_id: HirFileId) -> Arc<AstIdMap>
pub fn parse_or_expand(
&self,
file_id: HirFileId
) -> Option<SyntaxNode<RustLanguage>>
pub fn parse_or_expand(
&self,
file_id: HirFileId
) -> Option<SyntaxNode<RustLanguage>>
Main public API – parses a hir file, not caring whether it’s a real file or a macro expansion. Read more
Implementation for the macro case.
pub fn intern_macro_call(&self, macro_call: MacroCallLoc) -> MacroCallId
pub fn intern_macro_call(&self, macro_call: MacroCallLoc) -> MacroCallId
Macro ids. That’s probably the tricksiest bit in rust-analyzer, and the reason why we use salsa at all. Read more
pub fn lookup_intern_macro_call(&self, key: MacroCallId) -> MacroCallLoc
Lowers syntactic macro call to a token tree representation.
pub fn macro_arg_text(&self, id: MacroCallId) -> Option<GreenNode>
pub fn macro_arg_text(&self, id: MacroCallId) -> Option<GreenNode>
Extracts syntax node, corresponding to a macro call. That’s a firewall query, only typing in the macro call itself changes the returned subtree. Read more
Gets the expander for this macro. This compiles declarative macros, and just fetches procedural ones. Read more
pub fn macro_expand(
&self,
macro_call: MacroCallId
) -> ExpandResult<Option<Arc<Subtree>>>
pub fn macro_expand(
&self,
macro_call: MacroCallId
) -> ExpandResult<Option<Arc<Subtree>>>
Expand macro call to a token tree. This query is LRUed (we keep 128 or so results in memory)
pub fn expand_proc_macro(&self, call: MacroCallId) -> ExpandResult<Subtree>
pub fn expand_proc_macro(&self, call: MacroCallId) -> ExpandResult<Subtree>
Special case of the previous query for procedural macros. We can’t LRU proc macros, since they are not deterministic in general, and non-determinism breaks salsa in a very, very, very bad way. @edwin0cheng heroically debugged this once! Read more
pub fn macro_expand_error(&self, macro_call: MacroCallId) -> Option<ExpandError>
pub fn macro_expand_error(&self, macro_call: MacroCallId) -> Option<ExpandError>
Firewall query that returns the error from the macro_expand
query.
pub fn hygiene_frame(&self, file_id: HirFileId) -> Arc<HygieneFrame>
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
impl<DB> DefDatabase for DB where
DB: InternDatabase + AstDatabase + Upcast<dyn AstDatabase + 'static> + Database + HasQueryGroup<DefDatabaseStorage>,
impl<DB> DefDatabase for DB where
DB: InternDatabase + AstDatabase + Upcast<dyn AstDatabase + 'static> + Database + HasQueryGroup<DefDatabaseStorage>,
pub fn enable_proc_attr_macros(&self) -> bool
pub fn set_enable_proc_attr_macros(&mut self, value__: bool)
pub fn set_enable_proc_attr_macros(&mut self, value__: bool)
Set the value of the enable_proc_attr_macros
input. Read more
pub fn set_enable_proc_attr_macros_with_durability(
&mut self,
value__: bool,
durability__: Durability
)
pub fn set_enable_proc_attr_macros_with_durability(
&mut self,
value__: bool,
durability__: Durability
)
Set the value of the enable_proc_attr_macros
input and promise
that its value will never change again. Read more
pub fn file_item_tree(&self, file_id: HirFileId) -> Arc<ItemTree>
pub fn crate_def_map(&self, krate: CrateId) -> Arc<DefMap>
pub fn crate_def_map_query(&self, krate: CrateId) -> Arc<DefMap>
pub fn block_def_map(&self, block: BlockId) -> Option<Arc<DefMap>>
pub fn block_def_map(&self, block: BlockId) -> Option<Arc<DefMap>>
Computes the block-level DefMap
, returning None
when block
doesn’t contain any inner
items directly. Read more
pub fn struct_data(&self, id: StructId) -> Arc<StructData>
pub fn union_data(&self, id: UnionId) -> Arc<StructData>
pub fn trait_data(&self, e: TraitId) -> Arc<TraitData>
pub fn type_alias_data(&self, e: TypeAliasId) -> Arc<TypeAliasData>
pub fn function_data(&self, func: FunctionId) -> Arc<FunctionData>
pub fn const_data(&self, konst: ConstId) -> Arc<ConstData>
pub fn static_data(&self, konst: StaticId) -> Arc<StaticData>
pub fn body_with_source_map(
&self,
def: DefWithBodyId
) -> (Arc<Body>, Arc<BodySourceMap>)
pub fn expr_scopes(&self, def: DefWithBodyId) -> Arc<ExprScopes>
pub fn generic_params(&self, def: GenericDefId) -> Interned<GenericParams>
pub fn variants_attrs(
&self,
def: EnumId
) -> Arc<ArenaMap<Idx<EnumVariantData>, Attrs>>
pub fn fields_attrs(
&self,
def: VariantId
) -> Arc<ArenaMap<Idx<FieldData>, Attrs>>
pub fn variants_attrs_source_map(
&self,
def: EnumId
) -> Arc<ArenaMap<Idx<EnumVariantData>, AstPtr<Variant>>>
pub fn fields_attrs_source_map(
&self,
def: VariantId
) -> Arc<ArenaMap<Idx<FieldData>, Either<AstPtr<TupleField>, AstPtr<RecordField>>>>
pub fn attrs(&self, def: AttrDefId) -> AttrsWithOwner
pub fn crate_lang_items(&self, krate: CrateId) -> Arc<LangItems>
pub fn import_map(&self, krate: CrateId) -> Arc<ImportMap>
pub fn field_visibilities(
&self,
var: VariantId
) -> Arc<ArenaMap<Idx<FieldData>, Visibility>>
pub fn function_visibility(&self, def: FunctionId) -> Visibility
impl<DB> HirDatabase for DB where
DB: DefDatabase + Upcast<dyn DefDatabase + 'static> + Database + HasQueryGroup<HirDatabaseStorage>,
impl<DB> HirDatabase for DB where
DB: DefDatabase + Upcast<dyn DefDatabase + 'static> + Database + HasQueryGroup<HirDatabaseStorage>,
pub fn infer_query(&self, def: DefWithBodyId) -> Arc<InferenceResult>
pub fn ty(&self, def: TyDefId) -> Binders<Ty<Interner>>
pub fn value_ty(&self, def: ValueTyDefId) -> Binders<Ty<Interner>>
pub fn impl_self_ty(&self, def: ImplId) -> Binders<Ty<Interner>>
pub fn const_param_ty(&self, def: ConstParamId) -> Ty<Interner>
pub fn impl_trait(&self, def: ImplId) -> Option<Binders<TraitRef<Interner>>>
pub fn field_types(
&self,
var: VariantId
) -> Arc<ArenaMap<Idx<FieldData>, Binders<Ty<Interner>>>>
pub fn callable_item_signature(
&self,
def: CallableDefId
) -> Binders<CallableSig>
pub fn return_type_impl_traits(
&self,
def: FunctionId
) -> Option<Arc<Binders<ReturnTypeImplTraits>>>
pub fn generic_predicates_for_param(
&self,
param_id: TypeParamId,
assoc_name: Option<Name>
) -> Arc<[Binders<Binders<WhereClause<Interner>>>]>
pub fn generic_predicates(
&self,
def: GenericDefId
) -> Arc<[Binders<Binders<WhereClause<Interner>>>]>
pub fn trait_environment(&self, def: GenericDefId) -> Arc<TraitEnvironment>
pub fn generic_defaults(
&self,
def: GenericDefId
) -> Arc<[Binders<Ty<Interner>>]>
pub fn inherent_impls_in_crate(&self, krate: CrateId) -> Arc<InherentImpls>
pub fn inherent_impls_in_block(
&self,
block: BlockId
) -> Option<Arc<InherentImpls>>
pub fn trait_impls_in_crate(&self, krate: CrateId) -> Arc<TraitImpls>
pub fn trait_impls_in_block(&self, krate: BlockId) -> Option<Arc<TraitImpls>>
pub fn trait_impls_in_deps(&self, krate: CrateId) -> Arc<TraitImpls>
pub fn intern_callable_def(
&self,
callable_def: CallableDefId
) -> InternedCallableDefId
pub fn lookup_intern_callable_def(
&self,
key: InternedCallableDefId
) -> CallableDefId
pub fn intern_type_param_id(&self, param_id: TypeParamId) -> InternedTypeParamId
pub fn lookup_intern_type_param_id(
&self,
key: InternedTypeParamId
) -> TypeParamId
pub fn intern_lifetime_param_id(
&self,
param_id: LifetimeParamId
) -> InternedLifetimeParamId
pub fn lookup_intern_lifetime_param_id(
&self,
key: InternedLifetimeParamId
) -> LifetimeParamId
pub fn intern_const_param_id(
&self,
param_id: ConstParamId
) -> InternedConstParamId
pub fn lookup_intern_const_param_id(
&self,
key: InternedConstParamId
) -> ConstParamId
pub fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId
pub fn lookup_intern_impl_trait_id(
&self,
key: InternedOpaqueTyId
) -> ImplTraitId
pub fn intern_closure(
&self,
id: (DefWithBodyId, Idx<Expr>)
) -> InternedClosureId
pub fn lookup_intern_closure(
&self,
key: InternedClosureId
) -> (DefWithBodyId, Idx<Expr>)
pub fn associated_ty_data(
&self,
id: AssocTypeId<Interner>
) -> Arc<AssociatedTyDatum<Interner>>
pub fn trait_datum(
&self,
krate: CrateId,
trait_id: TraitId<Interner>
) -> Arc<TraitDatum<Interner>>
pub fn struct_datum(
&self,
krate: CrateId,
struct_id: AdtId<Interner>
) -> Arc<AdtDatum<Interner>>
pub fn impl_datum(
&self,
krate: CrateId,
impl_id: ImplId<Interner>
) -> Arc<ImplDatum<Interner>>
pub fn fn_def_datum(
&self,
krate: CrateId,
fn_def_id: FnDefId<Interner>
) -> Arc<FnDefDatum<Interner>>
pub fn fn_def_variance(
&self,
fn_def_id: FnDefId<Interner>
) -> Variances<Interner>
pub fn adt_variance(&self, adt_id: AdtId<Interner>) -> Variances<Interner>
pub fn associated_ty_value(
&self,
krate: CrateId,
id: AssociatedTyValueId<Interner>
) -> Arc<AssociatedTyValue<Interner>>
pub fn trait_solve(
&self,
krate: CrateId,
goal: Canonical<InEnvironment<Goal<Interner>>>
) -> Option<Solution<Interner>>
pub fn trait_solve_query(
&self,
krate: CrateId,
goal: Canonical<InEnvironment<Goal<Interner>>>
) -> Option<Solution<Interner>>
pub fn program_clauses_for_chalk_env(
&self,
krate: CrateId,
env: Environment<Interner>
) -> ProgramClauses<Interner>
impl<DB> InternDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<InternDatabaseStorage>,
impl<DB> InternDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<InternDatabaseStorage>,
pub fn intern_function(&self, loc: AssocItemLoc<Function>) -> FunctionId
pub fn lookup_intern_function(&self, key: FunctionId) -> AssocItemLoc<Function>
pub fn intern_struct(&self, loc: ItemLoc<Struct>) -> StructId
pub fn lookup_intern_struct(&self, key: StructId) -> ItemLoc<Struct>
pub fn intern_union(&self, loc: ItemLoc<Union>) -> UnionId
pub fn lookup_intern_union(&self, key: UnionId) -> ItemLoc<Union>
pub fn intern_enum(&self, loc: ItemLoc<Enum>) -> EnumId
pub fn lookup_intern_enum(&self, key: EnumId) -> ItemLoc<Enum>
pub fn intern_const(&self, loc: AssocItemLoc<Const>) -> ConstId
pub fn lookup_intern_const(&self, key: ConstId) -> AssocItemLoc<Const>
pub fn intern_static(&self, loc: ItemLoc<Static>) -> StaticId
pub fn lookup_intern_static(&self, key: StaticId) -> ItemLoc<Static>
pub fn intern_trait(&self, loc: ItemLoc<Trait>) -> TraitId
pub fn lookup_intern_trait(&self, key: TraitId) -> ItemLoc<Trait>
pub fn intern_type_alias(&self, loc: AssocItemLoc<TypeAlias>) -> TypeAliasId
pub fn lookup_intern_type_alias(
&self,
key: TypeAliasId
) -> AssocItemLoc<TypeAlias>
pub fn intern_impl(&self, loc: ItemLoc<Impl>) -> ImplId
pub fn lookup_intern_impl(&self, key: ImplId) -> ItemLoc<Impl>
pub fn intern_block(&self, loc: BlockLoc) -> BlockId
pub fn lookup_intern_block(&self, key: BlockId) -> BlockLoc
impl<DB> LineIndexDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<LineIndexDatabaseStorage>,
impl<DB> LineIndexDatabase for DB where
DB: SourceDatabase + Database + HasQueryGroup<LineIndexDatabaseStorage>,
impl<DB> SourceDatabase for DB where
DB: FileLoader + Debug + Database + HasQueryGroup<SourceDatabaseStorage>,
impl<DB> SourceDatabase for DB where
DB: FileLoader + Debug + Database + HasQueryGroup<SourceDatabaseStorage>,
The crate graph.
Set the value of the crate_graph
input. Read more
pub fn set_crate_graph_with_durability(
&mut self,
value__: Arc<CrateGraph>,
durability__: Durability
)
pub fn set_crate_graph_with_durability(
&mut self,
value__: Arc<CrateGraph>,
durability__: Durability
)
Set the value of the crate_graph
input and promise
that its value will never change again. Read more
impl<DB> SourceDatabaseExt for DB where
DB: SourceDatabase + Database + HasQueryGroup<SourceDatabaseExtStorage>,
impl<DB> SourceDatabaseExt for DB where
DB: SourceDatabase + Database + HasQueryGroup<SourceDatabaseExtStorage>,
Set the value of the file_text
input. Read more
pub fn set_file_text_with_durability(
&mut self,
file_id: FileId,
value__: Arc<String>,
durability__: Durability
)
pub fn set_file_text_with_durability(
&mut self,
file_id: FileId,
value__: Arc<String>,
durability__: Durability
)
Set the value of the file_text
input and promise
that its value will never change again. Read more
Path to a file, relative to the root of its source root. Source root of the file. Read more
Set the value of the file_source_root
input. Read more
pub fn set_file_source_root_with_durability(
&mut self,
file_id: FileId,
value__: SourceRootId,
durability__: Durability
)
pub fn set_file_source_root_with_durability(
&mut self,
file_id: FileId,
value__: SourceRootId,
durability__: Durability
)
Set the value of the file_source_root
input and promise
that its value will never change again. Read more
Contents of the source root.
Set the value of the source_root
input. Read more
pub fn set_source_root_with_durability(
&mut self,
id: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability
)
pub fn set_source_root_with_durability(
&mut self,
id: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability
)
Set the value of the source_root
input and promise
that its value will never change again. Read more
pub fn source_root_crates(
&self,
id: SourceRootId
) -> Arc<HashSet<CrateId, BuildHasherDefault<FxHasher>>>
impl<DB> SymbolsDatabase for DB where
DB: HirDatabase + SourceDatabaseExt + Upcast<dyn HirDatabase + 'static> + Database + HasQueryGroup<SymbolsDatabaseStorage>,
impl<DB> SymbolsDatabase for DB where
DB: HirDatabase + SourceDatabaseExt + Upcast<dyn HirDatabase + 'static> + Database + HasQueryGroup<SymbolsDatabaseStorage>,
The symbol index for a given module. These modules should only be in source roots that are inside local_roots. Read more
The symbol index for a given source root within library_roots.
The set of “local” (that is, from the current workspace) roots. Files in local roots are assumed to change frequently. Read more
Set the value of the local_roots
input. Read more
pub fn set_local_roots_with_durability(
&mut Self,
Arc<HashSet<SourceRootId, BuildHasherDefault<FxHasher>>>,
Durability
)
pub fn set_local_roots_with_durability(
&mut Self,
Arc<HashSet<SourceRootId, BuildHasherDefault<FxHasher>>>,
Durability
)
Set the value of the local_roots
input and promise
that its value will never change again. Read more
The set of roots for crates.io libraries. Files in libraries are assumed to never change. Read more
Set the value of the library_roots
input. Read more
pub fn set_library_roots_with_durability(
&mut Self,
Arc<HashSet<SourceRootId, BuildHasherDefault<FxHasher>>>,
Durability
)
pub fn set_library_roots_with_durability(
&mut Self,
Arc<HashSet<SourceRootId, BuildHasherDefault<FxHasher>>>,
Durability
)
Set the value of the library_roots
input and promise
that its value will never change again. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more