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.
barinstruct Foo { bar: u8 }Foo::Bar::0inenum 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>
impl<'tcx> FullDefKind<'tcx>
Sourcepub fn as_adt_mut(&mut self) -> Option<&mut Adt<'tcx>>
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
Sourcepub fn as_adt(&self) -> Option<&Adt<'tcx>>
pub fn as_adt(&self) -> Option<&Adt<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Adt, otherwise None
Sourcepub fn into_adt(self) -> Result<Adt<'tcx>, Self>
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
Sourcepub unsafe fn into_adt_unchecked(self) -> Adt<'tcx>
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.
Sourcepub unsafe fn as_adt_unchecked(&self) -> &Adt<'tcx>
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.
Sourcepub unsafe fn as_adt_mut_unchecked(&mut self) -> &mut Adt<'tcx>
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.
Sourcepub fn is_ty_alias(&self) -> bool
pub fn is_ty_alias(&self) -> bool
Returns true if this is a FullDefKind::TyAlias, otherwise false
Sourcepub fn as_ty_alias_mut(&mut self) -> Option<&mut TyAlias<'tcx>>
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
Sourcepub fn as_ty_alias(&self) -> Option<&TyAlias<'tcx>>
pub fn as_ty_alias(&self) -> Option<&TyAlias<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::TyAlias, otherwise None
Sourcepub fn into_ty_alias(self) -> Result<TyAlias<'tcx>, Self>
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
Sourcepub unsafe fn into_ty_alias_unchecked(self) -> TyAlias<'tcx>
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.
Sourcepub unsafe fn as_ty_alias_unchecked(&self) -> &TyAlias<'tcx>
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.
Sourcepub unsafe fn as_ty_alias_mut_unchecked(&mut self) -> &mut TyAlias<'tcx>
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.
Sourcepub fn is_foreign_ty(&self) -> bool
pub fn is_foreign_ty(&self) -> bool
Returns true if this is a FullDefKind::ForeignTy, otherwise false
Sourcepub fn is_assoc_ty(&self) -> bool
pub fn is_assoc_ty(&self) -> bool
Returns true if this is a FullDefKind::AssocTy, otherwise false
Sourcepub fn as_assoc_ty_mut(&mut self) -> Option<&mut AssocTy<'tcx>>
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
Sourcepub fn as_assoc_ty(&self) -> Option<&AssocTy<'tcx>>
pub fn as_assoc_ty(&self) -> Option<&AssocTy<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::AssocTy, otherwise None
Sourcepub fn into_assoc_ty(self) -> Result<AssocTy<'tcx>, Self>
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
Sourcepub unsafe fn into_assoc_ty_unchecked(self) -> AssocTy<'tcx>
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.
Sourcepub unsafe fn as_assoc_ty_unchecked(&self) -> &AssocTy<'tcx>
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.
Sourcepub unsafe fn as_assoc_ty_mut_unchecked(&mut self) -> &mut AssocTy<'tcx>
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.
Sourcepub fn is_opaque_ty(&self) -> bool
pub fn is_opaque_ty(&self) -> bool
Returns true if this is a FullDefKind::OpaqueTy, otherwise false
Sourcepub fn as_trait_mut(&mut self) -> Option<&mut Trait<'tcx>>
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
Sourcepub fn as_trait(&self) -> Option<&Trait<'tcx>>
pub fn as_trait(&self) -> Option<&Trait<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Trait, otherwise None
Sourcepub fn into_trait(self) -> Result<Trait<'tcx>, Self>
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
Sourcepub unsafe fn into_trait_unchecked(self) -> Trait<'tcx>
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.
Sourcepub unsafe fn as_trait_unchecked(&self) -> &Trait<'tcx>
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.
Sourcepub unsafe fn as_trait_mut_unchecked(&mut self) -> &mut Trait<'tcx>
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.
Sourcepub fn is_trait_alias(&self) -> bool
pub fn is_trait_alias(&self) -> bool
Returns true if this is a FullDefKind::TraitAlias, otherwise false
Sourcepub fn as_trait_alias_mut(&mut self) -> Option<&mut TraitAlias<'tcx>>
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
Sourcepub fn as_trait_alias(&self) -> Option<&TraitAlias<'tcx>>
pub fn as_trait_alias(&self) -> Option<&TraitAlias<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::TraitAlias, otherwise None
Sourcepub fn into_trait_alias(self) -> Result<TraitAlias<'tcx>, Self>
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
Sourcepub unsafe fn into_trait_alias_unchecked(self) -> TraitAlias<'tcx>
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.
Sourcepub unsafe fn as_trait_alias_unchecked(&self) -> &TraitAlias<'tcx>
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.
Sourcepub unsafe fn as_trait_alias_mut_unchecked(&mut self) -> &mut TraitAlias<'tcx>
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.
Sourcepub fn is_trait_impl(&self) -> bool
pub fn is_trait_impl(&self) -> bool
Returns true if this is a FullDefKind::TraitImpl, otherwise false
Sourcepub fn as_trait_impl_mut(&mut self) -> Option<&mut TraitImpl<'tcx>>
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
Sourcepub fn as_trait_impl(&self) -> Option<&TraitImpl<'tcx>>
pub fn as_trait_impl(&self) -> Option<&TraitImpl<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::TraitImpl, otherwise None
Sourcepub fn into_trait_impl(self) -> Result<TraitImpl<'tcx>, Self>
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
Sourcepub unsafe fn into_trait_impl_unchecked(self) -> TraitImpl<'tcx>
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.
Sourcepub unsafe fn as_trait_impl_unchecked(&self) -> &TraitImpl<'tcx>
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.
Sourcepub unsafe fn as_trait_impl_mut_unchecked(&mut self) -> &mut TraitImpl<'tcx>
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.
Sourcepub fn is_inherent_impl(&self) -> bool
pub fn is_inherent_impl(&self) -> bool
Returns true if this is a FullDefKind::InherentImpl, otherwise false
Sourcepub fn as_inherent_impl_mut(&mut self) -> Option<&mut InherentImpl<'tcx>>
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
Sourcepub fn as_inherent_impl(&self) -> Option<&InherentImpl<'tcx>>
pub fn as_inherent_impl(&self) -> Option<&InherentImpl<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::InherentImpl, otherwise None
Sourcepub fn into_inherent_impl(self) -> Result<InherentImpl<'tcx>, Self>
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
Sourcepub unsafe fn into_inherent_impl_unchecked(self) -> InherentImpl<'tcx>
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.
Sourcepub unsafe fn as_inherent_impl_unchecked(&self) -> &InherentImpl<'tcx>
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.
Sourcepub unsafe fn as_inherent_impl_mut_unchecked(
&mut self,
) -> &mut InherentImpl<'tcx>
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.
Sourcepub fn as_fn_mut(&mut self) -> Option<&mut Fn<'tcx>>
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
Sourcepub fn as_fn(&self) -> Option<&Fn<'tcx>>
pub fn as_fn(&self) -> Option<&Fn<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Fn, otherwise None
Sourcepub fn into_fn(self) -> Result<Fn<'tcx>, Self>
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
Sourcepub unsafe fn into_fn_unchecked(self) -> Fn<'tcx>
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.
Sourcepub unsafe fn as_fn_unchecked(&self) -> &Fn<'tcx>
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.
Sourcepub unsafe fn as_fn_mut_unchecked(&mut self) -> &mut Fn<'tcx>
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.
Sourcepub fn as_fn_ptr_mut(&mut self) -> Option<&mut FnPointer<'tcx>>
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
Sourcepub fn as_fn_ptr(&self) -> Option<&FnPointer<'tcx>>
pub fn as_fn_ptr(&self) -> Option<&FnPointer<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::FnPtr, otherwise None
Sourcepub fn into_fn_ptr(self) -> Result<FnPointer<'tcx>, Self>
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
Sourcepub unsafe fn into_fn_ptr_unchecked(self) -> FnPointer<'tcx>
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.
Sourcepub unsafe fn as_fn_ptr_unchecked(&self) -> &FnPointer<'tcx>
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.
Sourcepub unsafe fn as_fn_ptr_mut_unchecked(&mut self) -> &mut FnPointer<'tcx>
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.
Sourcepub fn is_assoc_fn(&self) -> bool
pub fn is_assoc_fn(&self) -> bool
Returns true if this is a FullDefKind::AssocFn, otherwise false
Sourcepub fn as_assoc_fn_mut(&mut self) -> Option<&mut AssocFn<'tcx>>
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
Sourcepub fn as_assoc_fn(&self) -> Option<&AssocFn<'tcx>>
pub fn as_assoc_fn(&self) -> Option<&AssocFn<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::AssocFn, otherwise None
Sourcepub fn into_assoc_fn(self) -> Result<AssocFn<'tcx>, Self>
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
Sourcepub unsafe fn into_assoc_fn_unchecked(self) -> AssocFn<'tcx>
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.
Sourcepub unsafe fn as_assoc_fn_unchecked(&self) -> &AssocFn<'tcx>
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.
Sourcepub unsafe fn as_assoc_fn_mut_unchecked(&mut self) -> &mut AssocFn<'tcx>
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.
Sourcepub fn is_closure(&self) -> bool
pub fn is_closure(&self) -> bool
Returns true if this is a FullDefKind::Closure, otherwise false
Sourcepub fn as_closure_mut(&mut self) -> Option<&mut Closure<'tcx>>
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
Sourcepub fn as_closure(&self) -> Option<&Closure<'tcx>>
pub fn as_closure(&self) -> Option<&Closure<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Closure, otherwise None
Sourcepub fn into_closure(self) -> Result<Closure<'tcx>, Self>
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
Sourcepub unsafe fn into_closure_unchecked(self) -> Closure<'tcx>
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.
Sourcepub unsafe fn as_closure_unchecked(&self) -> &Closure<'tcx>
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.
Sourcepub unsafe fn as_closure_mut_unchecked(&mut self) -> &mut Closure<'tcx>
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.
Sourcepub fn as_const_mut(&mut self) -> Option<&mut Const<'tcx>>
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
Sourcepub fn as_const(&self) -> Option<&Const<'tcx>>
pub fn as_const(&self) -> Option<&Const<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Const, otherwise None
Sourcepub fn into_const(self) -> Result<Const<'tcx>, Self>
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
Sourcepub unsafe fn into_const_unchecked(self) -> Const<'tcx>
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.
Sourcepub unsafe fn as_const_unchecked(&self) -> &Const<'tcx>
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.
Sourcepub unsafe fn as_const_mut_unchecked(&mut self) -> &mut Const<'tcx>
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.
Sourcepub fn is_assoc_const(&self) -> bool
pub fn is_assoc_const(&self) -> bool
Returns true if this is a FullDefKind::AssocConst, otherwise false
Sourcepub fn as_assoc_const_mut(&mut self) -> Option<&mut AssocConst<'tcx>>
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
Sourcepub fn as_assoc_const(&self) -> Option<&AssocConst<'tcx>>
pub fn as_assoc_const(&self) -> Option<&AssocConst<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::AssocConst, otherwise None
Sourcepub fn into_assoc_const(self) -> Result<AssocConst<'tcx>, Self>
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
Sourcepub unsafe fn into_assoc_const_unchecked(self) -> AssocConst<'tcx>
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.
Sourcepub unsafe fn as_assoc_const_unchecked(&self) -> &AssocConst<'tcx>
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.
Sourcepub unsafe fn as_assoc_const_mut_unchecked(&mut self) -> &mut AssocConst<'tcx>
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.
Sourcepub fn as_static_mut(&mut self) -> Option<&mut Static<'tcx>>
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
Sourcepub fn as_static(&self) -> Option<&Static<'tcx>>
pub fn as_static(&self) -> Option<&Static<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Static, otherwise None
Sourcepub fn into_static(self) -> Result<Static<'tcx>, Self>
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
Sourcepub unsafe fn into_static_unchecked(self) -> Static<'tcx>
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.
Sourcepub unsafe fn as_static_unchecked(&self) -> &Static<'tcx>
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.
Sourcepub unsafe fn as_static_mut_unchecked(&mut self) -> &mut Static<'tcx>
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.
Sourcepub fn is_extern_crate(&self) -> bool
pub fn is_extern_crate(&self) -> bool
Returns true if this is a FullDefKind::ExternCrate, otherwise false
Sourcepub fn as_mod_mut(&mut self) -> Option<&mut Mod>
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
Sourcepub fn as_mod(&self) -> Option<&Mod>
pub fn as_mod(&self) -> Option<&Mod>
Optionally returns references to the inner fields if this is a FullDefKind::Mod, otherwise None
Sourcepub fn into_mod(self) -> Result<Mod, Self>
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
Sourcepub unsafe fn into_mod_unchecked(self) -> Mod
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.
Sourcepub unsafe fn as_mod_unchecked(&self) -> &Mod
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.
Sourcepub unsafe fn as_mod_mut_unchecked(&mut self) -> &mut Mod
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.
Sourcepub fn is_foreign_mod(&self) -> bool
pub fn is_foreign_mod(&self) -> bool
Returns true if this is a FullDefKind::ForeignMod, otherwise false
Sourcepub fn as_foreign_mod_mut(&mut self) -> Option<&mut ForeignMod>
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
Sourcepub fn as_foreign_mod(&self) -> Option<&ForeignMod>
pub fn as_foreign_mod(&self) -> Option<&ForeignMod>
Optionally returns references to the inner fields if this is a FullDefKind::ForeignMod, otherwise None
Sourcepub fn into_foreign_mod(self) -> Result<ForeignMod, Self>
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
Sourcepub unsafe fn into_foreign_mod_unchecked(self) -> ForeignMod
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.
Sourcepub unsafe fn as_foreign_mod_unchecked(&self) -> &ForeignMod
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.
Sourcepub unsafe fn as_foreign_mod_mut_unchecked(&mut self) -> &mut ForeignMod
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.
Sourcepub fn is_ty_param(&self) -> bool
pub fn is_ty_param(&self) -> bool
Returns true if this is a FullDefKind::TyParam, otherwise false
Sourcepub fn is_const_param(&self) -> bool
pub fn is_const_param(&self) -> bool
Returns true if this is a FullDefKind::ConstParam, otherwise false
Sourcepub fn is_lifetime_param(&self) -> bool
pub fn is_lifetime_param(&self) -> bool
Returns true if this is a FullDefKind::LifetimeParam, otherwise false
Sourcepub fn is_variant(&self) -> bool
pub fn is_variant(&self) -> bool
Returns true if this is a FullDefKind::Variant, otherwise false
Sourcepub fn as_variant_mut(&mut self) -> Option<&mut ParamEnv<'tcx>>
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
Sourcepub fn as_variant(&self) -> Option<&ParamEnv<'tcx>>
pub fn as_variant(&self) -> Option<&ParamEnv<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Variant, otherwise None
Sourcepub fn into_variant(self) -> Result<ParamEnv<'tcx>, Self>
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
Sourcepub unsafe fn into_variant_unchecked(self) -> ParamEnv<'tcx>
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.
Sourcepub unsafe fn as_variant_unchecked(&self) -> &ParamEnv<'tcx>
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.
Sourcepub unsafe fn as_variant_mut_unchecked(&mut self) -> &mut ParamEnv<'tcx>
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.
Sourcepub fn as_ctor_mut(&mut self) -> Option<&mut Ctor<'tcx>>
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
Sourcepub fn as_ctor(&self) -> Option<&Ctor<'tcx>>
pub fn as_ctor(&self) -> Option<&Ctor<'tcx>>
Optionally returns references to the inner fields if this is a FullDefKind::Ctor, otherwise None
Sourcepub fn into_ctor(self) -> Result<Ctor<'tcx>, Self>
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
Sourcepub unsafe fn into_ctor_unchecked(self) -> Ctor<'tcx>
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.
Sourcepub unsafe fn as_ctor_unchecked(&self) -> &Ctor<'tcx>
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.
Sourcepub unsafe fn as_ctor_mut_unchecked(&mut self) -> &mut Ctor<'tcx>
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.
Sourcepub fn is_global_asm(&self) -> bool
pub fn is_global_asm(&self) -> bool
Returns true if this is a FullDefKind::GlobalAsm, otherwise false
Sourcepub fn is_synthetic_coroutine_body(&self) -> bool
pub fn is_synthetic_coroutine_body(&self) -> bool
Returns true if this is a FullDefKind::SyntheticCoroutineBody, otherwise false
Sourcepub fn is_test_binder_constraints(&self) -> bool
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>
impl<'tcx> Clone for FullDefKind<'tcx>
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> 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<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