pub struct FullDef {
pub this: ItemRef,
pub span: Span,
pub source_span: Option<Span>,
pub source_text: Option<String>,
pub attributes: Vec<Attribute>,
pub visibility: Option<bool>,
pub lang_item: Option<Symbol>,
pub diagnostic_item: Option<Symbol>,
pub kind: FullDefKind,
}Expand description
Gathers a lot of definition information about a rustc_hir::def_id::DefId.
Fields§
§this: ItemRefA reference to the current item. If the item was provided with generic args, they are stored here; otherwise the args are the identity_args for this item.
span: SpanThe span of the definition of this item (e.g. for a function this is is signature).
source_span: Option<Span>The span of the whole definition (including e.g. the function body).
source_text: Option<String>The text of the whole definition.
attributes: Vec<Attribute>Attributes on this definition, if applicable.
visibility: Option<bool>Visibility of the definition, for definitions where this makes sense.
lang_item: Option<Symbol>If this definition is a lang item, we store the identifier, e.g. sized.
diagnostic_item: Option<Symbol>If this definition is a diagnostic item, we store the identifier, e.g. box_new.
kind: FullDefKindImplementations§
Source§impl FullDef
impl FullDef
pub fn def_id(&self) -> &DefId
pub fn kind(&self) -> &FullDefKind
Sourcepub fn param_env(&self) -> Option<&ParamEnv>
pub fn param_env(&self) -> Option<&ParamEnv>
Returns the generics and predicates for definitions that have those.
Sourcepub fn typing_parent<'tcx>(&self, s: &impl BaseState<'tcx>) -> Option<ItemRef>
pub fn typing_parent<'tcx>(&self, s: &impl BaseState<'tcx>) -> Option<ItemRef>
Return the parent of this item if the item inherits the typing context from its parent.
Sourcepub fn has_any_generics(&self) -> bool
pub fn has_any_generics(&self) -> bool
Whether the item has any generics at all (including parent generics).
Sourcepub fn has_own_generics(&self) -> bool
pub fn has_own_generics(&self) -> bool
Whether the item has any generics of its own (ignoring parent generics).
Sourcepub fn has_own_generics_or_predicates(&self) -> bool
pub fn has_own_generics_or_predicates(&self) -> bool
Whether the item has any generics or predicates of its own (ignoring parent generics/predicates).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FullDef
impl RefUnwindSafe for FullDef
impl Send for FullDef
impl Sync for FullDef
impl Unpin for FullDef
impl UnwindSafe for FullDef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§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>
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>
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