pub struct FullDef<Body = MirBody<Unknown>> {
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<String>,
pub diagnostic_item: Option<String>,
pub kind: FullDefKind<Body>,
}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<String>If this definition is a lang item, we store the identifier, e.g. sized.
diagnostic_item: Option<String>If this definition is a diagnostic item, we store the identifier, e.g. box_new.
kind: FullDefKind<Body>Implementations§
Source§impl<Body> FullDef<Body>
impl<Body> FullDef<Body>
pub fn def_id(&self) -> &DefId
pub fn kind(&self) -> &FullDefKind<Body>
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§
Source§impl<'de, Body> Deserialize<'de> for FullDef<Body>where
Body: Deserialize<'de>,
impl<'de, Body> Deserialize<'de> for FullDef<Body>where
Body: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<Body: JsonSchema> JsonSchema for FullDef<Body>
impl<Body: JsonSchema> JsonSchema for FullDef<Body>
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl<Body> Freeze for FullDef<Body>where
Body: Freeze,
impl<Body> RefUnwindSafe for FullDef<Body>where
Body: RefUnwindSafe,
impl<Body> Send for FullDef<Body>where
Body: Send,
impl<Body> Sync for FullDef<Body>where
Body: Sync,
impl<Body> Unpin for FullDef<Body>where
Body: Unpin,
impl<Body> UnwindSafe for FullDef<Body>where
Body: UnwindSafe,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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