Enum hax_frontend_exporter::FullDefKind

source ·
pub enum FullDefKind {
Show 30 variants Mod, Struct { generics: TyGenerics, predicates: GenericPredicates, def: AdtDef, }, Union { generics: TyGenerics, predicates: GenericPredicates, def: AdtDef, }, Enum { generics: TyGenerics, predicates: GenericPredicates, def: AdtDef, }, Variant, Trait { generics: TyGenerics, predicates: GenericPredicates, self_predicate: TraitPredicate, items: Vec<(AssocItem, Arc<FullDef>)>, }, TyAlias { generics: TyGenerics, predicates: GenericPredicates, ty: Option<Ty>, }, ForeignTy, TraitAlias, AssocTy { parent: DefId, generics: TyGenerics, predicates: GenericPredicates, associated_item: AssocItem, value: Option<Ty>, }, TyParam, Fn { generics: TyGenerics, predicates: GenericPredicates, inline: InlineAttr, sig: PolyFnSig, }, AssocFn { parent: DefId, associated_item: AssocItem, generics: TyGenerics, predicates: GenericPredicates, inline: InlineAttr, sig: PolyFnSig, }, Closure { parent: DefId, args: ClosureArgs, }, Const { generics: TyGenerics, predicates: GenericPredicates, ty: Ty, }, AssocConst { parent: DefId, associated_item: AssocItem, generics: TyGenerics, predicates: GenericPredicates, ty: Ty, }, Static { safety: Safety, mutability: Mutability, nested: bool, generics: TyGenerics, predicates: GenericPredicates, ty: Ty, }, ConstParam, Ctor(CtorOf, CtorKind), Macro(MacroKind), ExternCrate, Use, ForeignMod, AnonConst, InlineConst, OpaqueTy, Impl { generics: TyGenerics, predicates: GenericPredicates, impl_subject: ImplSubject, items: Vec<(AssocItem, Arc<FullDef>)>, }, Field, LifetimeParam, GlobalAsm,
}
Expand description

Imbues rustc_hir::def::DefKind with a lot of extra information. Important: the owner_id() must be the id of this definition.

Variants§

§

Mod

§

Struct

Refers to the struct definition, [DefKind::Ctor] refers to its constructor if it exists.

Fields

§generics: TyGenerics
§

Union

Fields

§generics: TyGenerics
§

Enum

Fields

§generics: TyGenerics
§

Variant

Refers to the variant definition, [DefKind::Ctor] refers to its constructor if it exists.

§

Trait

Fields

§generics: TyGenerics
§self_predicate: TraitPredicate

The special Self: Trait clause.

§items: Vec<(AssocItem, Arc<FullDef>)>

Associated items, in definition order.

§

TyAlias

Type alias: type Foo = Bar;

Fields

§generics: TyGenerics
§ty: Option<Ty>

Some if the item is in the local crate.

§

ForeignTy

Type from an extern block.

§

TraitAlias

Trait alias: trait IntIterator = Iterator<Item = i32>;

§

AssocTy

Associated type: trait MyTrait { type Assoc; }

Fields

§parent: DefId
§generics: TyGenerics
§associated_item: AssocItem
§value: Option<Ty>
§

TyParam

Type parameter: the T in struct Vec<T> { ... }

§

Fn

Fields

§generics: TyGenerics
§inline: InlineAttr
§

AssocFn

Associated function: impl MyStruct { fn associated() {} } or trait Foo { fn associated() {} }

Fields

§parent: DefId
§associated_item: AssocItem
§generics: TyGenerics
§inline: InlineAttr
§

Closure

A closure, coroutine, or coroutine-closure.

Note: the (early-bound) generics of a closure are the same as those of the item in which it is defined.

Fields

§parent: DefId

The enclosing item. Note: this item could itself be a closure; to get the generics, you might have to recurse through several layers of parents until you find a function or constant.

§

Const

Fields

§generics: TyGenerics
§ty: Ty
§

AssocConst

Associated constant: trait MyTrait { const ASSOC: usize; }

Fields

§parent: DefId
§associated_item: AssocItem
§generics: TyGenerics
§ty: Ty
§

Static

Fields

§safety: Safety

Whether it’s a unsafe static, safe static (inside extern only) or just a static.

§mutability: Mutability

Whether it’s a static mut or just a static.

§nested: bool

Whether it’s an anonymous static generated for nested allocations.

§generics: TyGenerics
§ty: Ty
§

ConstParam

Constant generic parameter: struct Foo<const N: usize> { ... }

§

Ctor(CtorOf, CtorKind)

Refers to the struct or enum variant’s constructor.

§

Macro(MacroKind)

§

ExternCrate

§

Use

§

ForeignMod

An extern block.

§

AnonConst

Anonymous constant, e.g. the 1 + 2 in [u8; 1 + 2]

§

InlineConst

An inline constant, e.g. const { 1 + 2 }

§

OpaqueTy

Opaque type, aka impl Trait.

§

Impl

Fields

§generics: TyGenerics
§impl_subject: ImplSubject
§items: Vec<(AssocItem, Arc<FullDef>)>

Associated items, in definition order.

§

Field

A field in a struct, enum or union. e.g.

  • bar in struct Foo { bar: u8 }
  • Foo::Bar::0 in enum Foo { Bar(u8) }
§

LifetimeParam

Lifetime parameter: the 'a in struct Foo<'a> { ... }

§

GlobalAsm

A use of global_asm!.

Trait Implementations§

source§

impl<'__de> BorrowDecode<'__de> for FullDefKind

source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
source§

impl Clone for FullDefKind

source§

fn clone(&self) -> FullDefKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FullDefKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for FullDefKind

source§

fn decode<__D: Decoder>(decoder: &mut __D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
source§

impl<'de> Deserialize<'de> for FullDefKind

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Encode for FullDefKind

source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
source§

impl JsonSchema for FullDefKind

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl<'tcx, S: UnderOwnerState<'tcx>> SInto<S, FullDefKind> for DefKind

source§

fn sinto(&self, s: &S) -> FullDefKind

source§

impl Serialize for FullDefKind

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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.

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

impl<P> IntoQueryParam<P> for P

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,