Skip to main content

FullDefKind

Enum FullDefKind 

Source
pub enum FullDefKind<'tcx> {
Show 30 variants Adt(Adt<'tcx>), TyAlias(TyAlias<'tcx>), ForeignTy, AssocTy(AssocTy<'tcx>), OpaqueTy, Trait(Trait<'tcx>), TraitAlias(TraitAlias<'tcx>), TraitImpl(TraitImpl<'tcx>), InherentImpl(InherentImpl<'tcx>), Fn(Fn<'tcx>), FnPtr(FnPointer<'tcx>), AssocFn(AssocFn<'tcx>), Closure(Closure<'tcx>), Const(Const<'tcx>), AssocConst(AssocConst<'tcx>), Static(Static<'tcx>), ExternCrate, Use, Mod(Mod), ForeignMod(ForeignMod), TyParam, ConstParam, LifetimeParam, Variant(ParamEnv<'tcx>), Ctor(Ctor<'tcx>), Field, Macro, GlobalAsm, SyntheticCoroutineBody, TestBinderConstraints,
}
Expand description

Imbues rustc_hir::def::DefKind with a lot of extra information.

Variants§

§

Adt(Adt<'tcx>)

ADts (Struct, Enum and Union map to this variant).

§

TyAlias(TyAlias<'tcx>)

Type alias: type Foo = Bar;

§

ForeignTy

Type from an extern block.

§

AssocTy(AssocTy<'tcx>)

Associated type: trait MyTrait { type Assoc; }

§

OpaqueTy

Opaque type, aka impl Trait.

§

Trait(Trait<'tcx>)

§

TraitAlias(TraitAlias<'tcx>)

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

§

TraitImpl(TraitImpl<'tcx>)

§

InherentImpl(InherentImpl<'tcx>)

§

Fn(Fn<'tcx>)

§

FnPtr(FnPointer<'tcx>)

Synthetic item representing a particular shape of function pointer types. E.g. for<'a> fn(&'a u32) -> Adt<'a, u32> is considered to be an instantiation of the fake item for<'a> fn(&'a A) -> Adt<'a, B> with A=B=u32. Note how the item can therefore have trait clauses if some Adt does.

§

AssocFn(AssocFn<'tcx>)

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

§

Closure(Closure<'tcx>)

A closure, coroutine, or coroutine-closure.

§

Const(Const<'tcx>)

§

AssocConst(AssocConst<'tcx>)

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

§

Static(Static<'tcx>)

§

ExternCrate

§

Use

§

Mod(Mod)

§

ForeignMod(ForeignMod)

An extern block.

§

TyParam

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

§

ConstParam

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

§

LifetimeParam

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

§

Variant(ParamEnv<'tcx>)

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

§

Ctor(Ctor<'tcx>)

The constructor function of a tuple/unit struct or tuple/unit enum variant.

§

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) }
§

Macro

Macros

§

GlobalAsm

A use of global_asm!.

§

SyntheticCoroutineBody

A synthetic coroutine body created by the lowering of a coroutine-closure, such as an async closure.

§

TestBinderConstraints

Implementations§

Source§

impl<'tcx> FullDefKind<'tcx>

Source

pub fn is_adt(&self) -> bool

Returns true if this is a FullDefKind::Adt, otherwise false

Source

pub fn as_adt_mut(&mut self) -> Option<&mut Adt<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Adt, otherwise None

Source

pub fn as_adt(&self) -> Option<&Adt<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Adt, otherwise None

Source

pub fn into_adt(self) -> Result<Adt<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Adt, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_adt_unchecked(self) -> Adt<'tcx>

Unchecked return of the inner fields of FullDefKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_adt_unchecked(&self) -> &Adt<'tcx>

Unchecked reference of the inner fields of FullDefKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_adt_mut_unchecked(&mut self) -> &mut Adt<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Adt.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ty_alias(&self) -> bool

Returns true if this is a FullDefKind::TyAlias, otherwise false

Source

pub fn as_ty_alias_mut(&mut self) -> Option<&mut TyAlias<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::TyAlias, otherwise None

Source

pub fn as_ty_alias(&self) -> Option<&TyAlias<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::TyAlias, otherwise None

Source

pub fn into_ty_alias(self) -> Result<TyAlias<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::TyAlias, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_ty_alias_unchecked(self) -> TyAlias<'tcx>

Unchecked return of the inner fields of FullDefKind::TyAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ty_alias_unchecked(&self) -> &TyAlias<'tcx>

Unchecked reference of the inner fields of FullDefKind::TyAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ty_alias_mut_unchecked(&mut self) -> &mut TyAlias<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::TyAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_foreign_ty(&self) -> bool

Returns true if this is a FullDefKind::ForeignTy, otherwise false

Source

pub fn is_assoc_ty(&self) -> bool

Returns true if this is a FullDefKind::AssocTy, otherwise false

Source

pub fn as_assoc_ty_mut(&mut self) -> Option<&mut AssocTy<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::AssocTy, otherwise None

Source

pub fn as_assoc_ty(&self) -> Option<&AssocTy<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::AssocTy, otherwise None

Source

pub fn into_assoc_ty(self) -> Result<AssocTy<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::AssocTy, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_assoc_ty_unchecked(self) -> AssocTy<'tcx>

Unchecked return of the inner fields of FullDefKind::AssocTy.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_ty_unchecked(&self) -> &AssocTy<'tcx>

Unchecked reference of the inner fields of FullDefKind::AssocTy.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_ty_mut_unchecked(&mut self) -> &mut AssocTy<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::AssocTy.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_opaque_ty(&self) -> bool

Returns true if this is a FullDefKind::OpaqueTy, otherwise false

Source

pub fn is_trait(&self) -> bool

Returns true if this is a FullDefKind::Trait, otherwise false

Source

pub fn as_trait_mut(&mut self) -> Option<&mut Trait<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Trait, otherwise None

Source

pub fn as_trait(&self) -> Option<&Trait<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Trait, otherwise None

Source

pub fn into_trait(self) -> Result<Trait<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Trait, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_trait_unchecked(self) -> Trait<'tcx>

Unchecked return of the inner fields of FullDefKind::Trait.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_unchecked(&self) -> &Trait<'tcx>

Unchecked reference of the inner fields of FullDefKind::Trait.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_mut_unchecked(&mut self) -> &mut Trait<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Trait.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_trait_alias(&self) -> bool

Returns true if this is a FullDefKind::TraitAlias, otherwise false

Source

pub fn as_trait_alias_mut(&mut self) -> Option<&mut TraitAlias<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::TraitAlias, otherwise None

Source

pub fn as_trait_alias(&self) -> Option<&TraitAlias<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::TraitAlias, otherwise None

Source

pub fn into_trait_alias(self) -> Result<TraitAlias<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::TraitAlias, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_trait_alias_unchecked(self) -> TraitAlias<'tcx>

Unchecked return of the inner fields of FullDefKind::TraitAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_alias_unchecked(&self) -> &TraitAlias<'tcx>

Unchecked reference of the inner fields of FullDefKind::TraitAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_alias_mut_unchecked(&mut self) -> &mut TraitAlias<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::TraitAlias.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_trait_impl(&self) -> bool

Returns true if this is a FullDefKind::TraitImpl, otherwise false

Source

pub fn as_trait_impl_mut(&mut self) -> Option<&mut TraitImpl<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::TraitImpl, otherwise None

Source

pub fn as_trait_impl(&self) -> Option<&TraitImpl<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::TraitImpl, otherwise None

Source

pub fn into_trait_impl(self) -> Result<TraitImpl<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::TraitImpl, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_trait_impl_unchecked(self) -> TraitImpl<'tcx>

Unchecked return of the inner fields of FullDefKind::TraitImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_impl_unchecked(&self) -> &TraitImpl<'tcx>

Unchecked reference of the inner fields of FullDefKind::TraitImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_trait_impl_mut_unchecked(&mut self) -> &mut TraitImpl<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::TraitImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_inherent_impl(&self) -> bool

Returns true if this is a FullDefKind::InherentImpl, otherwise false

Source

pub fn as_inherent_impl_mut(&mut self) -> Option<&mut InherentImpl<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::InherentImpl, otherwise None

Source

pub fn as_inherent_impl(&self) -> Option<&InherentImpl<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::InherentImpl, otherwise None

Source

pub fn into_inherent_impl(self) -> Result<InherentImpl<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::InherentImpl, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_inherent_impl_unchecked(self) -> InherentImpl<'tcx>

Unchecked return of the inner fields of FullDefKind::InherentImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_inherent_impl_unchecked(&self) -> &InherentImpl<'tcx>

Unchecked reference of the inner fields of FullDefKind::InherentImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_inherent_impl_mut_unchecked( &mut self, ) -> &mut InherentImpl<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::InherentImpl.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_fn(&self) -> bool

Returns true if this is a FullDefKind::Fn, otherwise false

Source

pub fn as_fn_mut(&mut self) -> Option<&mut Fn<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Fn, otherwise None

Source

pub fn as_fn(&self) -> Option<&Fn<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Fn, otherwise None

Source

pub fn into_fn(self) -> Result<Fn<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Fn, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_fn_unchecked(self) -> Fn<'tcx>

Unchecked return of the inner fields of FullDefKind::Fn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_unchecked(&self) -> &Fn<'tcx>

Unchecked reference of the inner fields of FullDefKind::Fn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_mut_unchecked(&mut self) -> &mut Fn<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Fn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_fn_ptr(&self) -> bool

Returns true if this is a FullDefKind::FnPtr, otherwise false

Source

pub fn as_fn_ptr_mut(&mut self) -> Option<&mut FnPointer<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::FnPtr, otherwise None

Source

pub fn as_fn_ptr(&self) -> Option<&FnPointer<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::FnPtr, otherwise None

Source

pub fn into_fn_ptr(self) -> Result<FnPointer<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::FnPtr, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_fn_ptr_unchecked(self) -> FnPointer<'tcx>

Unchecked return of the inner fields of FullDefKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_ptr_unchecked(&self) -> &FnPointer<'tcx>

Unchecked reference of the inner fields of FullDefKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_fn_ptr_mut_unchecked(&mut self) -> &mut FnPointer<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::FnPtr.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_assoc_fn(&self) -> bool

Returns true if this is a FullDefKind::AssocFn, otherwise false

Source

pub fn as_assoc_fn_mut(&mut self) -> Option<&mut AssocFn<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::AssocFn, otherwise None

Source

pub fn as_assoc_fn(&self) -> Option<&AssocFn<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::AssocFn, otherwise None

Source

pub fn into_assoc_fn(self) -> Result<AssocFn<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::AssocFn, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_assoc_fn_unchecked(self) -> AssocFn<'tcx>

Unchecked return of the inner fields of FullDefKind::AssocFn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_fn_unchecked(&self) -> &AssocFn<'tcx>

Unchecked reference of the inner fields of FullDefKind::AssocFn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_fn_mut_unchecked(&mut self) -> &mut AssocFn<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::AssocFn.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_closure(&self) -> bool

Returns true if this is a FullDefKind::Closure, otherwise false

Source

pub fn as_closure_mut(&mut self) -> Option<&mut Closure<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Closure, otherwise None

Source

pub fn as_closure(&self) -> Option<&Closure<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Closure, otherwise None

Source

pub fn into_closure(self) -> Result<Closure<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Closure, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_closure_unchecked(self) -> Closure<'tcx>

Unchecked return of the inner fields of FullDefKind::Closure.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_closure_unchecked(&self) -> &Closure<'tcx>

Unchecked reference of the inner fields of FullDefKind::Closure.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_closure_mut_unchecked(&mut self) -> &mut Closure<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Closure.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_const(&self) -> bool

Returns true if this is a FullDefKind::Const, otherwise false

Source

pub fn as_const_mut(&mut self) -> Option<&mut Const<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Const, otherwise None

Source

pub fn as_const(&self) -> Option<&Const<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Const, otherwise None

Source

pub fn into_const(self) -> Result<Const<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Const, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_const_unchecked(self) -> Const<'tcx>

Unchecked return of the inner fields of FullDefKind::Const.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_const_unchecked(&self) -> &Const<'tcx>

Unchecked reference of the inner fields of FullDefKind::Const.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_const_mut_unchecked(&mut self) -> &mut Const<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Const.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_assoc_const(&self) -> bool

Returns true if this is a FullDefKind::AssocConst, otherwise false

Source

pub fn as_assoc_const_mut(&mut self) -> Option<&mut AssocConst<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::AssocConst, otherwise None

Source

pub fn as_assoc_const(&self) -> Option<&AssocConst<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::AssocConst, otherwise None

Source

pub fn into_assoc_const(self) -> Result<AssocConst<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::AssocConst, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_assoc_const_unchecked(self) -> AssocConst<'tcx>

Unchecked return of the inner fields of FullDefKind::AssocConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_const_unchecked(&self) -> &AssocConst<'tcx>

Unchecked reference of the inner fields of FullDefKind::AssocConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_assoc_const_mut_unchecked(&mut self) -> &mut AssocConst<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::AssocConst.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_static(&self) -> bool

Returns true if this is a FullDefKind::Static, otherwise false

Source

pub fn as_static_mut(&mut self) -> Option<&mut Static<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Static, otherwise None

Source

pub fn as_static(&self) -> Option<&Static<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Static, otherwise None

Source

pub fn into_static(self) -> Result<Static<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Static, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_static_unchecked(self) -> Static<'tcx>

Unchecked return of the inner fields of FullDefKind::Static.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_static_unchecked(&self) -> &Static<'tcx>

Unchecked reference of the inner fields of FullDefKind::Static.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_static_mut_unchecked(&mut self) -> &mut Static<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Static.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_extern_crate(&self) -> bool

Returns true if this is a FullDefKind::ExternCrate, otherwise false

Source

pub fn is_use(&self) -> bool

Returns true if this is a FullDefKind::Use, otherwise false

Source

pub fn is_mod(&self) -> bool

Returns true if this is a FullDefKind::Mod, otherwise false

Source

pub fn as_mod_mut(&mut self) -> Option<&mut Mod>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Mod, otherwise None

Source

pub fn as_mod(&self) -> Option<&Mod>

Optionally returns references to the inner fields if this is a FullDefKind::Mod, otherwise None

Source

pub fn into_mod(self) -> Result<Mod, Self>

Returns the inner fields if this is a FullDefKind::Mod, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_mod_unchecked(self) -> Mod

Unchecked return of the inner fields of FullDefKind::Mod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_mod_unchecked(&self) -> &Mod

Unchecked reference of the inner fields of FullDefKind::Mod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_mod_mut_unchecked(&mut self) -> &mut Mod

Unchecked mutable reference of the inner fields of FullDefKind::Mod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_foreign_mod(&self) -> bool

Returns true if this is a FullDefKind::ForeignMod, otherwise false

Source

pub fn as_foreign_mod_mut(&mut self) -> Option<&mut ForeignMod>

Optionally returns mutable references to the inner fields if this is a FullDefKind::ForeignMod, otherwise None

Source

pub fn as_foreign_mod(&self) -> Option<&ForeignMod>

Optionally returns references to the inner fields if this is a FullDefKind::ForeignMod, otherwise None

Source

pub fn into_foreign_mod(self) -> Result<ForeignMod, Self>

Returns the inner fields if this is a FullDefKind::ForeignMod, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_foreign_mod_unchecked(self) -> ForeignMod

Unchecked return of the inner fields of FullDefKind::ForeignMod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_foreign_mod_unchecked(&self) -> &ForeignMod

Unchecked reference of the inner fields of FullDefKind::ForeignMod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_foreign_mod_mut_unchecked(&mut self) -> &mut ForeignMod

Unchecked mutable reference of the inner fields of FullDefKind::ForeignMod.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ty_param(&self) -> bool

Returns true if this is a FullDefKind::TyParam, otherwise false

Source

pub fn is_const_param(&self) -> bool

Returns true if this is a FullDefKind::ConstParam, otherwise false

Source

pub fn is_lifetime_param(&self) -> bool

Returns true if this is a FullDefKind::LifetimeParam, otherwise false

Source

pub fn is_variant(&self) -> bool

Returns true if this is a FullDefKind::Variant, otherwise false

Source

pub fn as_variant_mut(&mut self) -> Option<&mut ParamEnv<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Variant, otherwise None

Source

pub fn as_variant(&self) -> Option<&ParamEnv<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Variant, otherwise None

Source

pub fn into_variant(self) -> Result<ParamEnv<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Variant, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_variant_unchecked(self) -> ParamEnv<'tcx>

Unchecked return of the inner fields of FullDefKind::Variant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_variant_unchecked(&self) -> &ParamEnv<'tcx>

Unchecked reference of the inner fields of FullDefKind::Variant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_variant_mut_unchecked(&mut self) -> &mut ParamEnv<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Variant.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_ctor(&self) -> bool

Returns true if this is a FullDefKind::Ctor, otherwise false

Source

pub fn as_ctor_mut(&mut self) -> Option<&mut Ctor<'tcx>>

Optionally returns mutable references to the inner fields if this is a FullDefKind::Ctor, otherwise None

Source

pub fn as_ctor(&self) -> Option<&Ctor<'tcx>>

Optionally returns references to the inner fields if this is a FullDefKind::Ctor, otherwise None

Source

pub fn into_ctor(self) -> Result<Ctor<'tcx>, Self>

Returns the inner fields if this is a FullDefKind::Ctor, otherwise returns back the enum in the Err case of the result

Source

pub unsafe fn into_ctor_unchecked(self) -> Ctor<'tcx>

Unchecked return of the inner fields of FullDefKind::Ctor.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ctor_unchecked(&self) -> &Ctor<'tcx>

Unchecked reference of the inner fields of FullDefKind::Ctor.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub unsafe fn as_ctor_mut_unchecked(&mut self) -> &mut Ctor<'tcx>

Unchecked mutable reference of the inner fields of FullDefKind::Ctor.

§Safety

Results in undefined behavior when it is the incorrect variant.

Source

pub fn is_field(&self) -> bool

Returns true if this is a FullDefKind::Field, otherwise false

Source

pub fn is_macro(&self) -> bool

Returns true if this is a FullDefKind::Macro, otherwise false

Source

pub fn is_global_asm(&self) -> bool

Returns true if this is a FullDefKind::GlobalAsm, otherwise false

Source

pub fn is_synthetic_coroutine_body(&self) -> bool

Returns true if this is a FullDefKind::SyntheticCoroutineBody, otherwise false

Source

pub fn is_test_binder_constraints(&self) -> bool

Returns true if this is a FullDefKind::TestBinderConstraints, otherwise false

Trait Implementations§

Source§

impl<'tcx> Clone for FullDefKind<'tcx>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'tcx> Debug for FullDefKind<'tcx>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'tcx> !DynSync for FullDefKind<'tcx>

§

impl<'tcx> !Freeze for FullDefKind<'tcx>

§

impl<'tcx> !RefUnwindSafe for FullDefKind<'tcx>

§

impl<'tcx> !Sync for FullDefKind<'tcx>

§

impl<'tcx> !UnwindSafe for FullDefKind<'tcx>

§

impl<'tcx> DynSend for FullDefKind<'tcx>

§

impl<'tcx> Forget for FullDefKind<'tcx>

§

impl<'tcx> Move for FullDefKind<'tcx>

§

impl<'tcx> Send for FullDefKind<'tcx>

§

impl<'tcx> Unpin for FullDefKind<'tcx>

§

impl<'tcx> UnsafeUnpin for FullDefKind<'tcx>

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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.

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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