pub(super) struct SourceToDefCtx<'db, 'cache> {
pub(super) db: &'db dyn HirDatabase,
pub(super) cache: &'cache mut SourceToDefCache,
}Fields§
§db: &'db dyn HirDatabase§cache: &'cache mut SourceToDefCacheImplementations§
Source§impl SourceToDefCtx<'_, '_>
impl SourceToDefCtx<'_, '_>
pub(super) fn file_to_def(&mut self, file: FileId) -> &SmallVec<[ModuleId; 1]>
pub(super) fn module_to_def(&mut self, src: InFile<&Module>) -> Option<ModuleId>
pub(super) fn source_file_to_def( &mut self, src: InFile<&SourceFile>, ) -> Option<ModuleId>
pub(super) fn trait_to_def(&mut self, src: InFile<&Trait>) -> Option<TraitId>
pub(super) fn impl_to_def(&mut self, src: InFile<&Impl>) -> Option<ImplId>
pub(super) fn fn_to_def(&mut self, src: InFile<&Fn>) -> Option<FunctionId>
pub(super) fn struct_to_def(&mut self, src: InFile<&Struct>) -> Option<StructId>
pub(super) fn enum_to_def(&mut self, src: InFile<&Enum>) -> Option<EnumId>
pub(super) fn union_to_def(&mut self, src: InFile<&Union>) -> Option<UnionId>
pub(super) fn static_to_def(&mut self, src: InFile<&Static>) -> Option<StaticId>
pub(super) fn const_to_def(&mut self, src: InFile<&Const>) -> Option<ConstId>
pub(super) fn type_alias_to_def( &mut self, src: InFile<&TypeAlias>, ) -> Option<TypeAliasId>
pub(super) fn record_field_to_def( &mut self, src: InFile<&RecordField>, ) -> Option<FieldId>
pub(super) fn tuple_field_to_def( &mut self, src: InFile<&TupleField>, ) -> Option<FieldId>
pub(super) fn block_to_def( &mut self, src: InFile<&BlockExpr>, ) -> Option<BlockId>
pub(super) fn enum_variant_to_def( &mut self, src: InFile<&Variant>, ) -> Option<EnumVariantId>
pub(super) fn extern_crate_to_def( &mut self, src: InFile<&ExternCrate>, ) -> Option<ExternCrateId>
pub(super) fn extern_block_to_def( &mut self, src: InFile<&ExternBlock>, ) -> Option<ExternBlockId>
pub(super) fn use_to_def(&mut self, src: InFile<&Use>) -> Option<UseId>
pub(super) fn adt_to_def(&mut self, _: InFile<&Adt>) -> Option<AdtId>
pub(super) fn asm_operand_to_def( &mut self, src: InFile<&AsmOperandNamed>, ) -> Option<InlineAsmOperand>
pub(super) fn bind_pat_to_def( &mut self, src: InFile<&IdentPat>, ) -> Option<(DefWithBodyId, BindingId)>
pub(super) fn self_param_to_def( &mut self, src: InFile<&SelfParam>, ) -> Option<(DefWithBodyId, BindingId)>
pub(super) fn label_to_def( &mut self, src: InFile<&Label>, ) -> Option<(DefWithBodyId, LabelId)>
pub(super) fn label_ref_to_def( &mut self, src: InFile<&Lifetime>, ) -> Option<(DefWithBodyId, LabelId)>
Sourcepub(super) fn attr_to_derive_macro_call(
&mut self,
item: InFile<&Adt>,
src: InFile<Attr>,
) -> Option<(AttrId, MacroCallId, &[Option<Either<MacroCallId, BuiltinDeriveImplId>>])>
pub(super) fn attr_to_derive_macro_call( &mut self, item: InFile<&Adt>, src: InFile<Attr>, ) -> Option<(AttrId, MacroCallId, &[Option<Either<MacroCallId, BuiltinDeriveImplId>>])>
(AttrId, derive attribute call id, derive call ids)
pub(super) fn file_of_adt_has_derives(&mut self, adt: InFile<&Adt>) -> bool
pub(super) fn derive_macro_calls<'slf>( &'slf mut self, adt: InFile<&Adt>, ) -> Option<impl Iterator<Item = (AttrId, MacroCallId, &'slf [Option<Either<MacroCallId, BuiltinDeriveImplId>>])> + use<'slf>>
fn to_def<Ast: AstNode + 'static, ID: Copy + 'static>( &mut self, src: InFile<&Ast>, key: Key<Ast, ID>, ) -> Option<ID>
fn dyn_map<Ast: AstNode + 'static>( &mut self, src: InFile<&Ast>, ) -> Option<&DynMap>
fn cache_for( &mut self, container: ChildContainer, file_id: HirFileId, ) -> &DynMap
pub(super) fn item_to_macro_call( &mut self, src: InFile<&Item>, ) -> Option<MacroCallId>
pub(super) fn macro_call_to_macro_call( &mut self, src: InFile<&MacroCall>, ) -> Option<MacroCallId>
pub(super) fn type_param_to_def( &mut self, src: InFile<&TypeParam>, ) -> Option<TypeParamId>
pub(super) fn lifetime_param_to_def( &mut self, src: InFile<&LifetimeParam>, ) -> Option<LifetimeParamId>
pub(super) fn const_param_to_def( &mut self, src: InFile<&ConstParam>, ) -> Option<ConstParamId>
pub(super) fn generic_param_to_def( &mut self, _: InFile<&GenericParam>, ) -> Option<GenericParamId>
pub(super) fn macro_to_def(&mut self, src: InFile<&Macro>) -> Option<MacroId>
pub(super) fn proc_macro_to_def(&mut self, src: InFile<&Fn>) -> Option<MacroId>
pub(super) fn find_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<ChildContainer>
fn find_generic_param_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<GenericDefId>
fn find_pat_or_label_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<DefWithBodyId>
Sourcefn parent_ancestors_with_macros<T>(
&mut self,
node: InFile<&SyntaxNode>,
cb: impl FnMut(&mut Self, InFile<SyntaxNode>, &SyntaxNode) -> Option<T>,
) -> Option<T>
fn parent_ancestors_with_macros<T>( &mut self, node: InFile<&SyntaxNode>, cb: impl FnMut(&mut Self, InFile<SyntaxNode>, &SyntaxNode) -> Option<T>, ) -> Option<T>
Skips the attributed item that caused the macro invocation we are climbing up
fn container_to_def( &mut self, container: InFile<SyntaxNode>, child: &SyntaxNode, ) -> Option<ChildContainer>
Auto Trait Implementations§
impl<'db, 'cache> Freeze for SourceToDefCtx<'db, 'cache>
impl<'db, 'cache> !RefUnwindSafe for SourceToDefCtx<'db, 'cache>
impl<'db, 'cache> !Send for SourceToDefCtx<'db, 'cache>
impl<'db, 'cache> !Sync for SourceToDefCtx<'db, 'cache>
impl<'db, 'cache> Unpin for SourceToDefCtx<'db, 'cache>
impl<'db, 'cache> !UnwindSafe for SourceToDefCtx<'db, 'cache>
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
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§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