SourceToDefCtx

Struct SourceToDefCtx 

Source
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 SourceToDefCache

Implementations§

Source§

impl SourceToDefCtx<'_, '_>

Source

pub(super) fn file_to_def(&mut self, file: FileId) -> &SmallVec<[ModuleId; 1]>

Source

pub(super) fn module_to_def(&mut self, src: InFile<&Module>) -> Option<ModuleId>

Source

pub(super) fn source_file_to_def( &mut self, src: InFile<&SourceFile>, ) -> Option<ModuleId>

Source

pub(super) fn trait_to_def(&mut self, src: InFile<&Trait>) -> Option<TraitId>

Source

pub(super) fn impl_to_def(&mut self, src: InFile<&Impl>) -> Option<ImplId>

Source

pub(super) fn fn_to_def(&mut self, src: InFile<&Fn>) -> Option<FunctionId>

Source

pub(super) fn struct_to_def(&mut self, src: InFile<&Struct>) -> Option<StructId>

Source

pub(super) fn enum_to_def(&mut self, src: InFile<&Enum>) -> Option<EnumId>

Source

pub(super) fn union_to_def(&mut self, src: InFile<&Union>) -> Option<UnionId>

Source

pub(super) fn static_to_def(&mut self, src: InFile<&Static>) -> Option<StaticId>

Source

pub(super) fn const_to_def(&mut self, src: InFile<&Const>) -> Option<ConstId>

Source

pub(super) fn type_alias_to_def( &mut self, src: InFile<&TypeAlias>, ) -> Option<TypeAliasId>

Source

pub(super) fn record_field_to_def( &mut self, src: InFile<&RecordField>, ) -> Option<FieldId>

Source

pub(super) fn tuple_field_to_def( &mut self, src: InFile<&TupleField>, ) -> Option<FieldId>

Source

pub(super) fn block_to_def( &mut self, src: InFile<&BlockExpr>, ) -> Option<BlockId>

Source

pub(super) fn enum_variant_to_def( &mut self, src: InFile<&Variant>, ) -> Option<EnumVariantId>

Source

pub(super) fn extern_crate_to_def( &mut self, src: InFile<&ExternCrate>, ) -> Option<ExternCrateId>

Source

pub(super) fn extern_block_to_def( &mut self, src: InFile<&ExternBlock>, ) -> Option<ExternBlockId>

Source

pub(super) fn use_to_def(&mut self, src: InFile<&Use>) -> Option<UseId>

Source

pub(super) fn adt_to_def(&mut self, _: InFile<&Adt>) -> Option<AdtId>

Source

pub(super) fn asm_operand_to_def( &mut self, src: InFile<&AsmOperandNamed>, ) -> Option<InlineAsmOperand>

Source

pub(super) fn bind_pat_to_def( &mut self, src: InFile<&IdentPat>, ) -> Option<(DefWithBodyId, BindingId)>

Source

pub(super) fn self_param_to_def( &mut self, src: InFile<&SelfParam>, ) -> Option<(DefWithBodyId, BindingId)>

Source

pub(super) fn label_to_def( &mut self, src: InFile<&Label>, ) -> Option<(DefWithBodyId, LabelId)>

Source

pub(super) fn label_ref_to_def( &mut self, src: InFile<&Lifetime>, ) -> Option<(DefWithBodyId, LabelId)>

Source

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)

Source

pub(super) fn file_of_adt_has_derives(&mut self, adt: InFile<&Adt>) -> bool

Source

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>>

Source

fn to_def<Ast: AstNode + 'static, ID: Copy + 'static>( &mut self, src: InFile<&Ast>, key: Key<Ast, ID>, ) -> Option<ID>

Source

fn dyn_map<Ast: AstNode + 'static>( &mut self, src: InFile<&Ast>, ) -> Option<&DynMap>

Source

fn cache_for( &mut self, container: ChildContainer, file_id: HirFileId, ) -> &DynMap

Source

pub(super) fn item_to_macro_call( &mut self, src: InFile<&Item>, ) -> Option<MacroCallId>

Source

pub(super) fn macro_call_to_macro_call( &mut self, src: InFile<&MacroCall>, ) -> Option<MacroCallId>

Source

pub(super) fn type_param_to_def( &mut self, src: InFile<&TypeParam>, ) -> Option<TypeParamId>

Source

pub(super) fn lifetime_param_to_def( &mut self, src: InFile<&LifetimeParam>, ) -> Option<LifetimeParamId>

Source

pub(super) fn const_param_to_def( &mut self, src: InFile<&ConstParam>, ) -> Option<ConstParamId>

Source

pub(super) fn generic_param_to_def( &mut self, _: InFile<&GenericParam>, ) -> Option<GenericParamId>

Source

pub(super) fn macro_to_def(&mut self, src: InFile<&Macro>) -> Option<MacroId>

Source

pub(super) fn proc_macro_to_def(&mut self, src: InFile<&Fn>) -> Option<MacroId>

Source

pub(super) fn find_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<ChildContainer>

Source

fn find_generic_param_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<GenericDefId>

Source

fn find_pat_or_label_container( &mut self, src: InFile<&SyntaxNode>, ) -> Option<DefWithBodyId>

Source

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

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, R> CollectAndApply<T, R> for T

§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

§

type Output = R

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

§

fn upcast(self, interner: I) -> U

§

impl<I, T> UpcastFrom<I, T> for T

§

fn upcast_from(from: T, _tcx: I) -> T

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<'a, T> Captures<'a> for T
where T: ?Sized,