pub struct RootDatabase {
pub(crate) storage: ManuallyDrop<Storage<Self>>,
pub(crate) files: Arc<Files>,
pub(crate) crates_map: Arc<CratesMap>,
pub(crate) nonce: Nonce,
}Fields§
§storage: ManuallyDrop<Storage<Self>>§files: Arc<Files>§crates_map: Arc<CratesMap>§nonce: NonceImplementations§
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
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
§fn trigger_lru_eviction(&mut self)
fn trigger_lru_eviction(&mut self)
Enforces current LRU limits, evicting entries if necessary. Read more
§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 more§fn trigger_cancellation(&mut self)
fn trigger_cancellation(&mut self)
This method cancels all outstanding computations.
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.
§fn cancellation_token(&self) -> CancellationToken
fn cancellation_token(&self) -> CancellationToken
Retrieves a [
CancellationToken] for the current database handle.§fn report_untracked_read(&self)
fn report_untracked_read(&self)
Reports that the query depends on some state unknown to salsa. Read more
§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
§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,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<DB> DefDatabase for DBwhere
DB: InternDatabase + ExpandDatabase + SourceDatabase,
impl<DB> DefDatabase for DBwhere
DB: InternDatabase + ExpandDatabase + SourceDatabase,
fn expand_proc_attr_macros(&self) -> bool
fn file_item_tree(&self, file_id: HirFileId, krate: Crate) -> &ItemTree
fn macro_def(&self, m: MacroId) -> MacroDefId
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, )
§impl<DB> ExpandDatabase for DBwhere
DB: SourceDatabase,
impl<DB> ExpandDatabase for DBwhere
DB: SourceDatabase,
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) -> &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, )
§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<Allocation<'db>, ConstEvalError>
fn const_eval_static<'db>( &'db self, def: StaticId, ) -> Result<Allocation<'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<'db>( &'db self, def: ExpressionStoreOwnerId, ) -> 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 variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>
fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<DB> InternDatabase for DBwhere
DB: SourceDatabase,
impl<DB> InternDatabase for DBwhere
DB: SourceDatabase,
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_anon_const(&self, loc: AnonConstLoc) -> AnonConstId
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_anon_const(&self, id: AnonConstId) -> AnonConstLoc
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 more§impl<T> Lookup<T> for T
impl<T> Lookup<T> for T
fn into_owned(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
§impl<DB> WithFixture for DBwhere
DB: ExpandDatabase + SourceDatabase + Default + 'static,
impl<DB> WithFixture for DBwhere
DB: ExpandDatabase + SourceDatabase + Default + 'static,
§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.
§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.
§fn with_files(ra_fixture: &str) -> Self
fn with_files(ra_fixture: &str) -> Self
See the trait documentation for more information on fixtures.
§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.
§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.
§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.
§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.