pub struct RootDatabase { /* private fields */ }Implementations§
Source§impl RootDatabase
impl RootDatabase
pub fn apply_change(&mut self, change: ChangeWithProcMacros)
pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes, usize)>
Source§impl RootDatabase
impl RootDatabase
pub fn new(lru_capacity: Option<u16>) -> RootDatabase
pub fn enable_proc_attr_macros(&mut self)
pub fn update_base_query_lru_capacities(&mut self, _lru_capacity: Option<u16>)
pub fn update_lru_capacities( &mut self, _lru_capacities: &FxHashMap<Box<str>, u16>, )
Trait Implementations§
Source§impl Clone for RootDatabase
impl Clone for RootDatabase
Source§impl Database for RootDatabase
impl Database for RootDatabase
Source§fn trigger_lru_eviction(&mut self)
fn trigger_lru_eviction(&mut self)
Enforces current LRU limits, evicting entries if necessary. Read more
Source§fn synthetic_write(&mut self, durability: Durability)
fn synthetic_write(&mut self, durability: Durability)
A “synthetic write” causes the system to act as though some
input of durability
durability has changed, triggering a new revision.
This is mostly useful for profiling scenarios. Read moreSource§fn trigger_cancellation(&mut self)
fn trigger_cancellation(&mut self)
This method triggers cancellation.
If you invoke it while a snapshot exists, it
will block until that snapshot is dropped – if that snapshot
is owned by the current thread, this could trigger deadlock.
Source§fn report_untracked_read(&self)
fn report_untracked_read(&self)
Reports that the query depends on some state unknown to salsa. Read more
Source§fn ingredient_debug_name(
&self,
ingredient_index: IngredientIndex,
) -> Cow<'_, str>
fn ingredient_debug_name( &self, ingredient_index: IngredientIndex, ) -> Cow<'_, str>
Return the “debug name” (i.e., the struct name, etc) for an “ingredient”,
which are the fine-grained components we use to track data. This is intended
for debugging and the contents of the returned string are not semver-guaranteed. Read more
Source§fn unwind_if_revision_cancelled(&self)
fn unwind_if_revision_cancelled(&self)
Starts unwinding the stack if the current revision is cancelled. Read more
Source§impl Debug for RootDatabase
impl Debug for RootDatabase
Source§impl Default for RootDatabase
impl Default for RootDatabase
Source§fn default() -> RootDatabase
fn default() -> RootDatabase
Returns the “default value” for a type. Read more
Source§impl Drop for RootDatabase
impl Drop for RootDatabase
Source§impl HasStorage for RootDatabase
impl HasStorage for RootDatabase
Source§impl SourceDatabase for RootDatabase
impl SourceDatabase for RootDatabase
Source§fn source_root(&self, source_root_id: SourceRootId) -> SourceRootInput
fn source_root(&self, source_root_id: SourceRootId) -> SourceRootInput
Source root of the file.
fn set_file_text(&mut self, file_id: FileId, text: &str)
fn set_file_text_with_durability( &mut self, file_id: FileId, text: &str, durability: Durability, )
Source§fn set_source_root_with_durability(
&mut self,
source_root_id: SourceRootId,
source_root: Arc<SourceRoot>,
durability: Durability,
)
fn set_source_root_with_durability( &mut self, source_root_id: SourceRootId, source_root: Arc<SourceRoot>, durability: Durability, )
Source root of the file.
fn file_source_root(&self, id: FileId) -> FileSourceRootInput
fn set_file_source_root_with_durability( &mut self, id: FileId, source_root_id: SourceRootId, durability: Durability, )
fn nonce_and_revision(&self) -> (Nonce, Revision)
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>
impl RefUnwindSafe for RootDatabase
Auto Trait Implementations§
impl !Freeze for RootDatabase
impl Send for RootDatabase
impl !Sync for RootDatabase
impl Unpin for RootDatabase
impl UnsafeUnpin for RootDatabase
impl !UnwindSafe for RootDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<DB> DefDatabase for DB
impl<DB> DefDatabase for DB
fn expand_proc_attr_macros(&self) -> bool
fn file_item_tree(&self, file_id: HirFileId) -> &ItemTree
fn macro_def(&self, m: MacroId) -> MacroDefId
fn trait_signature(&self, trait_: TraitId) -> Arc<TraitSignature>
fn impl_signature(&self, impl_: ImplId) -> Arc<ImplSignature>
fn struct_signature(&self, struct_: StructId) -> Arc<StructSignature>
fn union_signature(&self, union_: UnionId) -> Arc<UnionSignature>
fn enum_signature(&self, e: EnumId) -> Arc<EnumSignature>
fn const_signature(&self, e: ConstId) -> Arc<ConstSignature>
fn static_signature(&self, e: StaticId) -> Arc<StaticSignature>
fn function_signature(&self, e: FunctionId) -> Arc<FunctionSignature>
fn type_alias_signature(&self, e: TypeAliasId) -> Arc<TypeAliasSignature>
fn trait_signature_with_source_map( &self, trait_: TraitId, ) -> (Arc<TraitSignature>, Arc<ExpressionStoreSourceMap>)
fn impl_signature_with_source_map( &self, impl_: ImplId, ) -> (Arc<ImplSignature>, Arc<ExpressionStoreSourceMap>)
fn struct_signature_with_source_map( &self, struct_: StructId, ) -> (Arc<StructSignature>, Arc<ExpressionStoreSourceMap>)
fn union_signature_with_source_map( &self, union_: UnionId, ) -> (Arc<UnionSignature>, Arc<ExpressionStoreSourceMap>)
fn enum_signature_with_source_map( &self, e: EnumId, ) -> (Arc<EnumSignature>, Arc<ExpressionStoreSourceMap>)
fn const_signature_with_source_map( &self, e: ConstId, ) -> (Arc<ConstSignature>, Arc<ExpressionStoreSourceMap>)
fn static_signature_with_source_map( &self, e: StaticId, ) -> (Arc<StaticSignature>, Arc<ExpressionStoreSourceMap>)
fn function_signature_with_source_map( &self, e: FunctionId, ) -> (Arc<FunctionSignature>, Arc<ExpressionStoreSourceMap>)
fn type_alias_signature_with_source_map( &self, e: TypeAliasId, ) -> (Arc<TypeAliasSignature>, Arc<ExpressionStoreSourceMap>)
fn body_with_source_map( &self, def: DefWithBodyId, ) -> (Arc<Body>, Arc<BodySourceMap>)
fn body(&self, def: DefWithBodyId) -> Arc<Body>
fn expr_scopes(&self, def: DefWithBodyId) -> Arc<ExprScopes>
fn generic_params(&self, def: GenericDefId) -> Arc<GenericParams>
fn generic_params_and_store( &self, def: GenericDefId, ) -> (Arc<GenericParams>, Arc<ExpressionStore>)
fn generic_params_and_store_and_source_map( &self, def: GenericDefId, ) -> (Arc<GenericParams>, Arc<ExpressionStore>, Arc<ExpressionStoreSourceMap>)
fn import_map(&self, krate: Crate) -> Arc<ImportMap>
fn field_visibilities( &self, var: VariantId, ) -> Arc<ArenaMap<Idx<FieldData>, Visibility>>
fn assoc_visibility(&self, def: AssocItemId) -> Visibility
fn crate_notable_traits(&self, krate: Crate) -> Option<&[TraitId]>
fn crate_supports_no_std(&self, crate_id: Crate) -> bool
fn include_macro_invoc( &self, crate_id: Crate, ) -> Arc<[(MacroCallId, EditionedFileId)]>
fn set_expand_proc_attr_macros(&mut self, __value: bool)
fn set_expand_proc_attr_macros_with_durability( &mut self, __value: bool, durability: Durability, )
Source§impl<DB> ExpandDatabase for DBwhere
DB: RootQueryDb,
impl<DB> ExpandDatabase for DBwhere
DB: RootQueryDb,
fn proc_macros(&self) -> Arc<ProcMacros>
fn proc_macros_for_crate(&self, krate: Crate) -> Option<Arc<CrateProcMacros>>
fn ast_id_map(&self, file_id: HirFileId) -> Arc<AstIdMap>
fn resolve_span(&self, span: Span) -> FileRangeWrapper<EditionedFileId>
fn parse_or_expand(&self, file_id: HirFileId) -> SyntaxNode<RustLanguage>
fn parse_macro_expansion( &self, macro_file: MacroCallId, ) -> ValueResult<(Parse<SyntaxNode<RustLanguage>>, Arc<SpanMap>), ExpandError>
fn span_map(&self, file_id: HirFileId) -> SpanMap
fn expansion_span_map(&self, file_id: MacroCallId) -> Arc<SpanMap>
fn real_span_map(&self, file_id: EditionedFileId) -> Arc<RealSpanMap>
fn intern_macro_call(&self, macro_call: MacroCallLoc) -> MacroCallId
fn lookup_intern_macro_call(&self, macro_call: MacroCallId) -> MacroCallLoc
fn macro_arg( &self, id: MacroCallId, ) -> (Arc<TopSubtree>, SyntaxFixupUndoInfo, Span)
fn macro_arg_considering_derives( &self, id: MacroCallId, kind: &MacroCallKind, ) -> (Arc<TopSubtree>, SyntaxFixupUndoInfo, Span)
fn macro_expander(&self, id: MacroDefId) -> TokenExpander
fn decl_macro_expander( &self, def_crate: Crate, id: InFileWrapper<HirFileId, FileAstId<Macro>>, ) -> Arc<DeclarativeMacroExpander>
fn expand_proc_macro( &self, call: MacroCallId, ) -> ValueResult<Arc<TopSubtree>, ExpandError>
fn proc_macro_span(&self, fun: InFileWrapper<HirFileId, FileAstId<Fn>>) -> Span
fn parse_macro_expansion_error( &self, macro_call: MacroCallId, ) -> Option<Arc<ValueResult<Arc<[SyntaxError]>, ExpandError>>>
fn syntax_context(&self, file: HirFileId, edition: Edition) -> SyntaxContext
fn set_proc_macros(&mut self, __value: Arc<ProcMacros>)
fn set_proc_macros_with_durability( &mut self, __value: Arc<ProcMacros>, durability: Durability, )
Source§impl<DB> HirDatabase for DBwhere
DB: DefDatabase + Debug,
impl<DB> HirDatabase for DBwhere
DB: DefDatabase + Debug,
fn mir_body(&self, def: DefWithBodyId) -> Result<Arc<MirBody>, MirLowerError>
fn mir_body_for_closure( &self, def: InternedClosureId, ) -> Result<Arc<MirBody>, MirLowerError>
fn monomorphized_mir_body( &self, def: DefWithBodyId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<Arc<MirBody>, MirLowerError>
fn monomorphized_mir_body_for_closure( &self, def: InternedClosureId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<Arc<MirBody>, MirLowerError>
fn borrowck( &self, def: DefWithBodyId, ) -> Result<Arc<[BorrowckResult]>, MirLowerError>
fn const_eval<'db>( &'db self, def: ConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Const<'db>, ConstEvalError>
fn const_eval_static<'db>( &'db self, def: StaticId, ) -> Result<Const<'db>, ConstEvalError>
fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>
fn lookup_impl_method<'db>( &'db self, env: ParamEnvAndCrate<'db>, func: FunctionId, fn_subst: GenericArgs<'db>, ) -> (Either<FunctionId, (BuiltinDeriveImplId, BuiltinDeriveImplMethod)>, GenericArgs<'db>)
fn layout_of_adt( &self, def: AdtId, args: StoredGenericArgs, trait_env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>
fn layout_of_ty( &self, ty: StoredTy, env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>
fn target_data_layout( &self, krate: Crate, ) -> Result<Arc<TargetDataLayout>, TargetLoadError>
fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>
fn ty<'db>(&'db self, def: TyDefId) -> EarlyBinder<DbInterner<'db>, Ty<'db>>
fn type_for_type_alias_with_diagnostics<'db>( &'db self, def: TypeAliasId, ) -> (EarlyBinder<DbInterner<'db>, Ty<'db>>, Option<ThinArc<(), TyLoweringDiagnostic>>)
fn value_ty<'db>( &'db self, def: ValueTyDefId, ) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>
fn impl_self_ty_with_diagnostics<'db>( &'db self, def: ImplId, ) -> (EarlyBinder<DbInterner<'db>, Ty<'db>>, Option<ThinArc<(), TyLoweringDiagnostic>>)
fn impl_self_ty<'db>( &'db self, def: ImplId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>
fn const_param_ty_with_diagnostics<'db>( &'db self, def: ConstParamId, ) -> (Ty<'db>, Option<ThinArc<(), TyLoweringDiagnostic>>)
fn const_param_ty_ns<'db>(&'db self, def: ConstParamId) -> Ty<'db>
fn impl_trait_with_diagnostics<'db>( &'db self, def: ImplId, ) -> Option<(EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>, Option<ThinArc<(), TyLoweringDiagnostic>>)>
fn impl_trait<'db>( &'db self, def: ImplId, ) -> Option<EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>>
fn field_types_with_diagnostics( &self, var: VariantId, ) -> &(ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>, Option<ThinArc<(), TyLoweringDiagnostic>>)
fn field_types( &self, var: VariantId, ) -> &ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>
fn callable_item_signature<'db>( &'db self, def: CallableDefId, ) -> EarlyBinder<DbInterner<'db>, Binder<DbInterner<'db>, FnSig<DbInterner<'db>>>>
fn trait_environment_for_body<'db>( &'db self, def: DefWithBodyId, ) -> ParamEnv<'db>
fn trait_environment<'db>(&'db self, def: GenericDefId) -> ParamEnv<'db>
fn generic_defaults_with_diagnostics( &self, def: GenericDefId, ) -> (GenericDefaults, Option<ThinArc<(), TyLoweringDiagnostic>>)
fn generic_defaults(&self, def: GenericDefId) -> GenericDefaults
fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId
fn intern_closure(&self, id: InternedClosure) -> InternedClosureId
fn intern_coroutine(&self, id: InternedCoroutine) -> InternedCoroutineId
fn variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>
fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId
fn lookup_intern_closure(&self, id: InternedClosureId) -> InternedClosure
fn lookup_intern_coroutine(&self, id: InternedCoroutineId) -> InternedCoroutine
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<DB> InternDatabase for DBwhere
DB: RootQueryDb,
impl<DB> InternDatabase for DBwhere
DB: RootQueryDb,
fn intern_use(&self, loc: ItemLoc<Use>) -> UseId
fn intern_extern_crate(&self, loc: ItemLoc<ExternCrate>) -> ExternCrateId
fn intern_function(&self, loc: AssocItemLoc<Fn>) -> FunctionId
fn intern_struct(&self, loc: ItemLoc<Struct>) -> StructId
fn intern_union(&self, loc: ItemLoc<Union>) -> UnionId
fn intern_enum(&self, loc: ItemLoc<Enum>) -> EnumId
fn intern_enum_variant(&self, loc: EnumVariantLoc) -> EnumVariantId
fn intern_const(&self, loc: AssocItemLoc<Const>) -> ConstId
fn intern_static(&self, loc: AssocItemLoc<Static>) -> StaticId
fn intern_trait(&self, loc: ItemLoc<Trait>) -> TraitId
fn intern_type_alias(&self, loc: AssocItemLoc<TypeAlias>) -> TypeAliasId
fn intern_impl(&self, loc: ItemLoc<Impl>) -> ImplId
fn intern_extern_block(&self, loc: ItemLoc<ExternBlock>) -> ExternBlockId
fn intern_macro2(&self, loc: Macro2Loc) -> Macro2Id
fn intern_proc_macro(&self, loc: ProcMacroLoc) -> ProcMacroId
fn intern_macro_rules(&self, loc: MacroRulesLoc) -> MacroRulesId
fn intern_block(&self, loc: BlockLoc) -> BlockId
fn lookup_intern_use(&self, id: UseId) -> ItemLoc<Use>
fn lookup_intern_extern_crate(&self, id: ExternCrateId) -> ItemLoc<ExternCrate>
fn lookup_intern_function(&self, id: FunctionId) -> AssocItemLoc<Fn>
fn lookup_intern_struct(&self, id: StructId) -> ItemLoc<Struct>
fn lookup_intern_union(&self, id: UnionId) -> ItemLoc<Union>
fn lookup_intern_enum(&self, id: EnumId) -> ItemLoc<Enum>
fn lookup_intern_enum_variant(&self, id: EnumVariantId) -> EnumVariantLoc
fn lookup_intern_const(&self, id: ConstId) -> AssocItemLoc<Const>
fn lookup_intern_static(&self, id: StaticId) -> AssocItemLoc<Static>
fn lookup_intern_trait(&self, id: TraitId) -> ItemLoc<Trait>
fn lookup_intern_type_alias(&self, id: TypeAliasId) -> AssocItemLoc<TypeAlias>
fn lookup_intern_impl(&self, id: ImplId) -> ItemLoc<Impl>
fn lookup_intern_extern_block(&self, id: ExternBlockId) -> ItemLoc<ExternBlock>
fn lookup_intern_macro2(&self, id: Macro2Id) -> Macro2Loc
fn lookup_intern_proc_macro(&self, id: ProcMacroId) -> ProcMacroLoc
fn lookup_intern_macro_rules(&self, id: MacroRulesId) -> MacroRulesLoc
fn lookup_intern_block(&self, id: BlockId) -> BlockLoc
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<DB> LineIndexDatabase for DBwhere
DB: RootQueryDb,
impl<DB> LineIndexDatabase for DBwhere
DB: RootQueryDb,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<DB> RootQueryDb for DBwhere
DB: SourceDatabase + Database,
impl<DB> RootQueryDb for DBwhere
DB: SourceDatabase + Database,
fn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>
fn parse_errors(&self, file_id: EditionedFileId) -> Option<&[SyntaxError]>
fn toolchain_channel(&self, krate: Crate) -> Option<ReleaseChannel>
fn source_root_crates(&self, id: SourceRootId) -> Arc<[Crate]>
fn relevant_crates(&self, file_id: FileId) -> Arc<[Crate]>
fn all_crates(&self) -> Arc<Box<[Crate]>>
fn set_all_crates(&mut self, __value: Arc<Box<[Crate]>>)
fn set_all_crates_with_durability( &mut self, __value: Arc<Box<[Crate]>>, durability: Durability, )
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<DB> WithFixture for DB
impl<DB> WithFixture for DB
Source§fn with_single_file(ra_fixture: &str) -> (Self, EditionedFileId)
fn with_single_file(ra_fixture: &str) -> (Self, EditionedFileId)
See the trait documentation for more information on fixtures.
Source§fn with_many_files(ra_fixture: &str) -> (Self, Vec<EditionedFileId>)
fn with_many_files(ra_fixture: &str) -> (Self, Vec<EditionedFileId>)
See the trait documentation for more information on fixtures.
Source§fn with_files(ra_fixture: &str) -> Self
fn with_files(ra_fixture: &str) -> Self
See the trait documentation for more information on fixtures.
Source§fn with_files_extra_proc_macros(
ra_fixture: &str,
proc_macros: Vec<(String, ProcMacro)>,
) -> Self
fn with_files_extra_proc_macros( ra_fixture: &str, proc_macros: Vec<(String, ProcMacro)>, ) -> Self
See the trait documentation for more information on fixtures.
Source§fn with_position(
ra_fixture: &str,
) -> (Self, FilePositionWrapper<EditionedFileId>)
fn with_position( ra_fixture: &str, ) -> (Self, FilePositionWrapper<EditionedFileId>)
See the trait documentation for more information on fixtures.
Source§fn with_range(ra_fixture: &str) -> (Self, FileRangeWrapper<EditionedFileId>)
fn with_range(ra_fixture: &str) -> (Self, FileRangeWrapper<EditionedFileId>)
See the trait documentation for more information on fixtures.
Source§fn with_range_or_offset(
ra_fixture: &str,
) -> (Self, EditionedFileId, RangeOrOffset)
fn with_range_or_offset( ra_fixture: &str, ) -> (Self, EditionedFileId, RangeOrOffset)
See the trait documentation for more information on fixtures.