pub enum ResTarget {
Def {
def: GlobalDefId,
local: LocalItemId,
kind: ItemKind,
},
Local(LocalBindId),
Generic(GenericBindId),
SelfTy {
target: ImplTargetKey,
trait_def: GlobalDefId,
},
Prim(PrimTy),
}Expand description
Semantic target of a resolved identifier / path segment.
Variants§
Def
Module, ADT, variant, function, associated item, field, const, static, type alias, or macro.
Local(LocalBindId)
Local variable or self parameter declared in the enclosing body.
Generic(GenericBindId)
Generic type parameter (!is_const) or const generic parameter (is_const).
SelfTy
Self inside an impl (target known) or trait (trait_def known).
Prim(PrimTy)
Builtin primitive type (u32, str, bool, …).
Implementations§
Source§impl ResTarget
impl ResTarget
Sourcepub const fn effective_def_id(self) -> Option<GlobalDefId>
pub const fn effective_def_id(self) -> Option<GlobalDefId>
Returns the underlying GlobalDefId when this target names a concrete definition
(including Self inside impl Adt, which maps to adt_def just like rustc’s SelfTyAlias).
pub fn effective_def_id_in(self, file_res: &FileNameRes) -> Option<GlobalDefId>
pub const fn is_local(self) -> bool
Trait Implementations§
impl Copy for ResTarget
impl Eq for ResTarget
Source§impl Ord for ResTarget
impl Ord for ResTarget
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for ResTarget
impl PartialOrd for ResTarget
impl StructuralPartialEq for ResTarget
Auto Trait Implementations§
impl Forget for ResTarget
impl Freeze for ResTarget
impl Move for ResTarget
impl RefUnwindSafe for ResTarget
impl Send for ResTarget
impl Sync for ResTarget
impl Unpin for ResTarget
impl UnsafeUnpin for ResTarget
impl UnwindSafe for ResTarget
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
Mutably borrows from an owned value. Read more