Struct Db
pub struct Db { /* private fields */ }
Trait Implementations§
§impl Database for Db
impl Database for Db
§fn sweep_all(&self, strategy: SweepStrategy)
fn sweep_all(&self, strategy: SweepStrategy)
Iterates through all query storage and removes any values that
have not been used since the last revision was created. The
intended use-cycle is that you first execute all of your
“main” queries; this will ensure that all query values they
consume are marked as used. You then invoke this method to
remove other values that were not needed for your main query
results.
§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.
§fn on_propagated_panic(&self) -> !
fn on_propagated_panic(&self) -> !
This function is invoked when a dependent query is being computed by the
other thread, and that thread panics.
§fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime.
§fn salsa_runtime_mut(&mut self) -> &mut Runtime
fn salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime.
§impl UpcastMut<dyn AnalyzerDb> for Db
impl UpcastMut<dyn AnalyzerDb> for Db
fn upcast_mut(&mut self) -> &mut (dyn AnalyzerDb + 'static)
§impl UpcastMut<dyn MirDb> for Db
impl UpcastMut<dyn MirDb> for Db
fn upcast_mut(&mut self) -> &mut (dyn MirDb + 'static)
Auto Trait Implementations§
impl !Freeze for Db
impl RefUnwindSafe for Db
impl !Send for Db
impl !Sync for Db
impl Unpin for Db
impl UnwindSafe for Db
Blanket Implementations§
§impl<DB> AnalyzerDb for DB
impl<DB> AnalyzerDb for DB
fn intern_ingot(&self, key0: Rc<Ingot>) -> IngotId
fn lookup_intern_ingot(&self, key0: IngotId) -> Rc<Ingot>
fn intern_module(&self, key0: Rc<Module>) -> ModuleId
fn lookup_intern_module(&self, key0: ModuleId) -> Rc<Module>
fn intern_module_const(&self, key0: Rc<ModuleConstant>) -> ModuleConstantId
fn lookup_intern_module_const( &self, key0: ModuleConstantId, ) -> Rc<ModuleConstant>
fn intern_struct(&self, key0: Rc<Struct>) -> StructId
fn lookup_intern_struct(&self, key0: StructId) -> Rc<Struct>
fn intern_struct_field(&self, key0: Rc<StructField>) -> StructFieldId
fn lookup_intern_struct_field(&self, key0: StructFieldId) -> Rc<StructField>
fn intern_enum(&self, key0: Rc<Enum>) -> EnumId
fn lookup_intern_enum(&self, key0: EnumId) -> Rc<Enum>
fn intern_attribute(&self, key0: Rc<Attribute>) -> AttributeId
fn lookup_intern_attribute(&self, key0: AttributeId) -> Rc<Attribute>
fn intern_enum_variant(&self, key0: Rc<EnumVariant>) -> EnumVariantId
fn lookup_intern_enum_variant(&self, key0: EnumVariantId) -> Rc<EnumVariant>
fn intern_trait(&self, key0: Rc<Trait>) -> TraitId
fn lookup_intern_trait(&self, key0: TraitId) -> Rc<Trait>
fn intern_impl(&self, key0: Rc<Impl>) -> ImplId
fn lookup_intern_impl(&self, key0: ImplId) -> Rc<Impl>
fn intern_type_alias(&self, key0: Rc<TypeAlias>) -> TypeAliasId
fn lookup_intern_type_alias(&self, key0: TypeAliasId) -> Rc<TypeAlias>
fn intern_contract(&self, key0: Rc<Contract>) -> ContractId
fn lookup_intern_contract(&self, key0: ContractId) -> Rc<Contract>
fn intern_contract_field(&self, key0: Rc<ContractField>) -> ContractFieldId
fn lookup_intern_contract_field( &self, key0: ContractFieldId, ) -> Rc<ContractField>
fn intern_function_sig(&self, key0: Rc<FunctionSig>) -> FunctionSigId
fn lookup_intern_function_sig(&self, key0: FunctionSigId) -> Rc<FunctionSig>
fn intern_function(&self, key0: Rc<Function>) -> FunctionId
fn lookup_intern_function(&self, key0: FunctionId) -> Rc<Function>
fn intern_type(&self, key0: Type) -> TypeId
fn lookup_intern_type(&self, key0: TypeId) -> Type
fn ingot_files(&self, key0: IngotId) -> Rc<[SourceFileId]>
§fn set_ingot_files(&mut self, key0: IngotId, value__: Rc<[SourceFileId]>)
fn set_ingot_files(&mut self, key0: IngotId, value__: Rc<[SourceFileId]>)
Set the value of the
ingot_files
input. Read more§fn set_ingot_files_with_durability(
&mut self,
key0: IngotId,
value__: Rc<[SourceFileId]>,
durability__: Durability,
)
fn set_ingot_files_with_durability( &mut self, key0: IngotId, value__: Rc<[SourceFileId]>, durability__: Durability, )
Set the value of the
ingot_files
input and promise
that its value will never change again. Read morefn ingot_external_ingots(&self, key0: IngotId) -> Rc<IndexMap<SmolStr, IngotId>>
§fn set_ingot_external_ingots(
&mut self,
key0: IngotId,
value__: Rc<IndexMap<SmolStr, IngotId>>,
)
fn set_ingot_external_ingots( &mut self, key0: IngotId, value__: Rc<IndexMap<SmolStr, IngotId>>, )
Set the value of the
ingot_external_ingots
input. Read more§fn set_ingot_external_ingots_with_durability(
&mut self,
key0: IngotId,
value__: Rc<IndexMap<SmolStr, IngotId>>,
durability__: Durability,
)
fn set_ingot_external_ingots_with_durability( &mut self, key0: IngotId, value__: Rc<IndexMap<SmolStr, IngotId>>, durability__: Durability, )
Set the value of the
ingot_external_ingots
input and promise
that its value will never change again. Read morefn root_ingot(&self) -> IngotId
§fn set_root_ingot(&mut self, value__: IngotId)
fn set_root_ingot(&mut self, value__: IngotId)
Set the value of the
root_ingot
input. Read more§fn set_root_ingot_with_durability(
&mut self,
value__: IngotId,
durability__: Durability,
)
fn set_root_ingot_with_durability( &mut self, value__: IngotId, durability__: Durability, )
Set the value of the
root_ingot
input and promise
that its value will never change again. Read morefn ingot_modules(&self, key0: IngotId) -> Rc<[ModuleId]>
fn ingot_root_module(&self, key0: IngotId) -> Option<ModuleId>
fn module_file_path(&self, key0: ModuleId) -> SmolStr
fn module_parse(&self, key0: ModuleId) -> Analysis<Rc<Module>>
fn module_is_incomplete(&self, key0: ModuleId) -> bool
fn module_all_items(&self, key0: ModuleId) -> Rc<[Item]>
fn module_all_impls(&self, key0: ModuleId) -> Analysis<Rc<[ImplId]>>
fn module_item_map( &self, key0: ModuleId, ) -> Analysis<Rc<IndexMap<SmolStr, Item>>>
fn module_impl_map( &self, key0: ModuleId, ) -> Analysis<Rc<IndexMap<(TraitId, TypeId), ImplId>>>
fn module_contracts(&self, key0: ModuleId) -> Rc<[ContractId]>
fn module_structs(&self, key0: ModuleId) -> Rc<[StructId]>
fn module_constants(&self, key0: ModuleId) -> Rc<Vec<ModuleConstantId>>
fn module_used_item_map( &self, key0: ModuleId, ) -> Analysis<Rc<IndexMap<SmolStr, (Span, Item)>>>
fn module_parent_module(&self, key0: ModuleId) -> Option<ModuleId>
fn module_submodules(&self, key0: ModuleId) -> Rc<[ModuleId]>
fn module_tests(&self, key0: ModuleId) -> Vec<FunctionId>
fn module_constant_type( &self, key0: ModuleConstantId, ) -> Analysis<Result<TypeId, TypeError>>
fn module_constant_value( &self, key0: ModuleConstantId, ) -> Analysis<Result<Constant, ConstEvalError>>
fn contract_all_functions(&self, key0: ContractId) -> Rc<[FunctionId]>
fn contract_function_map( &self, key0: ContractId, ) -> Analysis<Rc<IndexMap<SmolStr, FunctionId>>>
fn contract_public_function_map( &self, key0: ContractId, ) -> Rc<IndexMap<SmolStr, FunctionId>>
fn contract_init_function( &self, key0: ContractId, ) -> Analysis<Option<FunctionId>>
fn contract_call_function( &self, key0: ContractId, ) -> Analysis<Option<FunctionId>>
fn contract_all_fields(&self, key0: ContractId) -> Rc<[ContractFieldId]>
fn contract_field_map( &self, key0: ContractId, ) -> Analysis<Rc<IndexMap<SmolStr, ContractFieldId>>>
fn contract_field_type( &self, key0: ContractFieldId, ) -> Analysis<Result<TypeId, TypeError>>
fn contract_dependency_graph(&self, key0: ContractId) -> DepGraphWrapper
fn contract_runtime_dependency_graph(&self, key0: ContractId) -> DepGraphWrapper
fn function_signature( &self, key0: FunctionSigId, ) -> Analysis<Rc<FunctionSignature>>
fn function_body(&self, key0: FunctionId) -> Analysis<Rc<FunctionBody>>
fn function_dependency_graph(&self, key0: FunctionId) -> DepGraphWrapper
fn struct_all_fields(&self, key0: StructId) -> Rc<[StructFieldId]>
fn struct_field_map( &self, key0: StructId, ) -> Analysis<Rc<IndexMap<SmolStr, StructFieldId>>>
fn struct_field_type( &self, key0: StructFieldId, ) -> Analysis<Result<TypeId, TypeError>>
fn struct_all_functions(&self, key0: StructId) -> Rc<[FunctionId]>
fn struct_function_map( &self, key0: StructId, ) -> Analysis<Rc<IndexMap<SmolStr, FunctionId>>>
fn struct_dependency_graph(&self, key0: StructId) -> Analysis<DepGraphWrapper>
fn enum_all_variants(&self, key0: EnumId) -> Rc<[EnumVariantId]>
fn enum_variant_map( &self, key0: EnumId, ) -> Analysis<Rc<IndexMap<SmolStr, EnumVariantId>>>
fn enum_all_functions(&self, key0: EnumId) -> Rc<[FunctionId]>
fn enum_function_map( &self, key0: EnumId, ) -> Analysis<Rc<IndexMap<SmolStr, FunctionId>>>
fn enum_dependency_graph(&self, key0: EnumId) -> Analysis<DepGraphWrapper>
fn enum_variant_kind( &self, key0: EnumVariantId, ) -> Analysis<Result<EnumVariantKind, TypeError>>
fn trait_all_functions(&self, key0: TraitId) -> Rc<[FunctionSigId]>
fn trait_function_map( &self, key0: TraitId, ) -> Analysis<Rc<IndexMap<SmolStr, FunctionSigId>>>
fn trait_is_implemented_for(&self, key0: TraitId, key1: TypeId) -> bool
fn impl_all_functions(&self, key0: ImplId) -> Rc<[FunctionId]>
fn impl_function_map( &self, key0: ImplId, ) -> Analysis<Rc<IndexMap<SmolStr, FunctionId>>>
fn all_impls(&self, key0: TypeId) -> Rc<[ImplId]>
fn impl_for(&self, key0: TypeId, key1: TraitId) -> Option<ImplId>
fn function_sigs(&self, key0: TypeId, key1: SmolStr) -> Rc<[FunctionSigId]>
fn type_alias_type( &self, key0: TypeAliasId, ) -> Analysis<Result<TypeId, TypeError>>
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
§impl<DB> CodegenDb for DB
impl<DB> CodegenDb for DB
fn codegen_legalized_signature(&self, key0: FunctionId) -> Rc<FunctionSignature>
fn codegen_legalized_body(&self, key0: FunctionId) -> Rc<FunctionBody>
fn codegen_function_symbol_name(&self, key0: FunctionId) -> Rc<String>
fn codegen_legalized_type(&self, key0: TypeId) -> TypeId
fn codegen_abi_type(&self, key0: TypeId) -> AbiType
fn codegen_abi_function(&self, key0: FunctionId) -> AbiFunction
fn codegen_abi_event(&self, key0: TypeId) -> AbiEvent
fn codegen_abi_contract(&self, key0: ContractId) -> AbiContract
fn codegen_abi_module_events(&self, key0: ModuleId) -> Vec<AbiEvent>
fn codegen_abi_type_maximum_size(&self, key0: TypeId) -> usize
fn codegen_abi_type_minimum_size(&self, key0: TypeId) -> usize
fn codegen_abi_function_argument_maximum_size(&self, key0: FunctionId) -> usize
fn codegen_abi_function_return_maximum_size(&self, key0: FunctionId) -> usize
fn codegen_contract_symbol_name(&self, key0: ContractId) -> Rc<String>
fn codegen_contract_deployer_symbol_name(&self, key0: ContractId) -> Rc<String>
fn codegen_constant_string_symbol_name(&self, key0: String) -> Rc<String>
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<DB> MirDb for DB
impl<DB> MirDb for DB
fn mir_intern_const(&self, key0: Rc<Constant>) -> ConstantId
fn lookup_mir_intern_const(&self, key0: ConstantId) -> Rc<Constant>
fn mir_intern_type(&self, key0: Rc<Type>) -> TypeId
fn lookup_mir_intern_type(&self, key0: TypeId) -> Rc<Type>
fn mir_intern_function(&self, key0: Rc<FunctionSignature>) -> FunctionId
fn lookup_mir_intern_function(&self, key0: FunctionId) -> Rc<FunctionSignature>
fn mir_lower_module_all_functions(&self, key0: ModuleId) -> Rc<Vec<FunctionId>>
fn mir_lower_contract_all_functions( &self, key0: ContractId, ) -> Rc<Vec<FunctionId>>
fn mir_lower_struct_all_functions(&self, key0: StructId) -> Rc<Vec<FunctionId>>
fn mir_lower_enum_all_functions(&self, key0: EnumId) -> Rc<Vec<FunctionId>>
fn mir_lowered_type(&self, key0: TypeId) -> TypeId
fn mir_lowered_constant(&self, key0: ModuleConstantId) -> ConstantId
fn mir_lowered_func_signature(&self, key0: FunctionId) -> FunctionId
fn mir_lowered_monomorphized_func_signature( &self, key0: FunctionId, key1: BTreeMap<SmolStr, TypeId>, ) -> FunctionId
fn mir_lowered_pseudo_monomorphized_func_signature( &self, key0: FunctionId, ) -> FunctionId
fn mir_lowered_func_body(&self, key0: FunctionId) -> Rc<FunctionBody>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<DB> SourceDb for DBwhere
DB: Database + HasQueryGroup<SourceDbStorage>,
impl<DB> SourceDb for DBwhere
DB: Database + HasQueryGroup<SourceDbStorage>,
fn intern_file(&self, key0: File) -> SourceFileId
fn lookup_intern_file(&self, key0: SourceFileId) -> File
Source§fn file_content(&self, key0: SourceFileId) -> Rc<str>
fn file_content(&self, key0: SourceFileId) -> Rc<str>
Set with `fn set_file_content(&mut self, file: SourceFileId, content: Rc)
Source§fn set_file_content(&mut self, key0: SourceFileId, value__: Rc<str>)
fn set_file_content(&mut self, key0: SourceFileId, value__: Rc<str>)
Set the value of the
file_content
input. Read moreSource§fn set_file_content_with_durability(
&mut self,
key0: SourceFileId,
value__: Rc<str>,
durability__: Durability,
)
fn set_file_content_with_durability( &mut self, key0: SourceFileId, value__: Rc<str>, durability__: Durability, )
Set the value of the
file_content
input and promise
that its value will never change again. Read morefn file_line_starts(&self, key0: SourceFileId) -> Rc<[usize]>
fn file_name(&self, key0: SourceFileId) -> SmolStr
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.