pub struct RootDatabase {
pub(crate) storage: ManuallyDrop<Storage<RootDatabase>>,
pub(crate) files: Arc<Files>,
pub(crate) crates_map: Arc<CratesMap>,
pub(crate) nonce: Nonce,
}Fields§
§storage: ManuallyDrop<Storage<RootDatabase>>§files: Arc<Files>§crates_map: Arc<CratesMap>§nonce: NonceImplementations§
Source§impl RootDatabase
impl RootDatabase
pub fn apply_change(&mut self, change: ChangeWithProcMacros) -> Duration
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: &HashMap<Box<str>, u16, FxBuildHasher>, )
Trait Implementations§
Source§impl Clone for RootDatabase
impl Clone for RootDatabase
Source§fn clone(&self) -> RootDatabase
fn clone(&self) -> RootDatabase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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
impl RefUnwindSafe 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 line_column(&self, file: FileId, offset: TextSize) -> Result<(u32, u32), ()>
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>
Auto Trait Implementations§
impl !Freeze for RootDatabase
impl !Sync for RootDatabase
impl !UnwindSafe for RootDatabase
impl Send for RootDatabase
impl Unpin for RootDatabase
impl UnsafeUnpin 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
Source§impl<T> HirDatabase for Twhere
T: SourceDatabase,
impl<T> HirDatabase for Twhere
T: SourceDatabase,
Source§fn as_dyn(&self) -> &(dyn HirDatabase + 'static)
fn as_dyn(&self) -> &(dyn HirDatabase + 'static)
fn mir_body<'db>( &'db self, def: InferBodyId<'db>, ) -> Result<&'db MirBody<'db>, MirLowerError<'db>>
fn mir_body_for_closure<'db>( &'db self, def: InternedClosureId<'db>, ) -> Result<&'db MirBody<'db>, MirLowerError<'db>>
fn monomorphized_mir_body<'db>( &'db self, def: InferBodyId<'db>, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&'db MirBody<'db>, MirLowerError<'db>>
fn monomorphized_mir_body_for_closure<'db>( &'db self, def: InternedClosureId<'db>, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&'db MirBody<'db>, MirLowerError<'db>>
fn const_eval<'db>( &'db self, def: ConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError<'db>>
fn anon_const_eval<'db>( &'db self, def: AnonConstId<'db>, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError<'db>>
fn const_eval_static<'db>( &'db self, def: StaticId, ) -> Result<Allocation<'db>, ConstEvalError<'db>>
fn const_eval_discriminant<'db>( &'db self, def: EnumVariantId, ) -> Result<i128, ConstEvalError<'db>>
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<&TargetDataLayout, TargetLoadError>
fn target_data_layout_or_default(&self, krate: Crate) -> &TargetDataLayout
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, ) -> &'db TyLoweringResult<'db, WithDefinedOpaques<StoredEarlyBinder<StoredTy>>>
Source§fn value_ty<'db>(
&'db self,
def: ValueTyDefId,
) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>
fn value_ty<'db>( &'db self, def: ValueTyDefId, ) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>
Returns the type of the value of the given constant, or
None if the ValueTyDefId is
a StructId or EnumVariantId with a record constructor.fn type_for_const<'db>( &'db self, def: ConstId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>
fn type_for_const_with_diagnostics<'db>( &'db self, def: ConstId, ) -> &'db TyLoweringResult<'db, StoredEarlyBinder<StoredTy>>
fn type_for_static<'db>( &'db self, def: StaticId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>
fn type_for_static_with_diagnostics<'db>( &'db self, def: StaticId, ) -> &'db TyLoweringResult<'db, StoredEarlyBinder<StoredTy>>
fn impl_self_ty_with_diagnostics<'db>( &'db self, def: ImplId, ) -> &'db TyLoweringResult<'db, StoredEarlyBinder<StoredTy>>
fn impl_self_ty<'db>( &'db self, def: ImplId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>
fn const_param_types_with_diagnostics<'db>( &'db self, def: GenericDefId, ) -> &'db TyLoweringResult<'db, ConstParamTypes>
fn const_param_types(&self, def: GenericDefId) -> &ConstParamTypes
fn const_param_ty<'db>(&'db self, def: ConstParamId) -> Ty<'db>
fn impl_trait_with_diagnostics<'db>( &'db self, def: ImplId, ) -> &'db Option<TyLoweringResult<'db, StoredEarlyBinder<StoredTraitRef>>>
fn impl_trait<'db>( &'db self, def: ImplId, ) -> Option<EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>>
fn field_types_with_diagnostics<'db>( &'db self, var: VariantId, ) -> &'db TyLoweringResult<'db, FieldTypes>
fn field_types(&self, var: VariantId) -> &ArenaMap<Idx<FieldData>, FieldType>
fn callable_item_signature<'db>( &'db self, def: CallableDefId, ) -> EarlyBinder<DbInterner<'db>, Binder<DbInterner<'db>, FnSig<DbInterner<'db>>>>
fn fn_sig_for_fn_with_diagnostics<'db>( &'db self, def: FunctionId, ) -> &'db TyLoweringResult<'db, WithDefinedOpaques<StoredEarlyBinder<StoredPolyFnSig>>>
fn trait_environment<'db>(&'db self, def: GenericDefId) -> ParamEnv<'db>
fn generic_defaults_with_diagnostics<'db>( &'db self, def: GenericDefId, ) -> &'db TyLoweringResult<'db, GenericDefaults>
Source§fn generic_defaults(&self, def: GenericDefId) -> GenericDefaultsRef<'_>
fn generic_defaults(&self, def: GenericDefId) -> GenericDefaultsRef<'_>
This returns an empty list if no parameter has default. Read more
fn type_alias_bounds_with_diagnostics<'db>( &'db self, type_alias: TypeAliasId, ) -> &'db TyLoweringResult<'db, TypeAliasBounds<StoredEarlyBinder<StoredClauses>>>
fn type_alias_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>
fn type_alias_self_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>
fn variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>
§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>
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: SourceDatabase + Default + 'static,
impl<DB> WithFixture for DBwhere
DB: 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.