Enum flux_middle::ResolvedDefId
source · pub enum ResolvedDefId {
Local(LocalDefId),
ExternSpec(LocalDefId, DefId),
Extern(DefId),
}
Expand description
Normally, a DefId
is either local or external, and DefId::as_local
can be used to
distinguish between the two. However, extern specs introduce a third case: a local definition
wrapping an extern spec. This enum is a type level reminder used to differentiate between these
three cases.
The construction of ResolvedDefId
is not encapsulated, but it is recommended to use
GlobalEnv::resolve_id
to create one.
This is used when we are given a DefId
and we need to resolve it into one of these three
cases. For handling local items that may correspond to an extern spec, see MaybeExternId
.
Variants§
Local(LocalDefId)
A local definition. Corresponds to MaybeExternId::Local
.
ExternSpec(LocalDefId, DefId)
A “dummy” local definition wrapping an extern spec. The LocalDefId
is for the local item,
and the DefId
is the resolved id for the external spec. Corresponds to
MaybeExternId::Extern
.
Extern(DefId)
An external definition with no corresponding (local) extern spec.
Implementations§
source§impl ResolvedDefId
impl ResolvedDefId
pub fn as_maybe_extern(self) -> Option<MaybeExternId>
Trait Implementations§
source§impl Clone for ResolvedDefId
impl Clone for ResolvedDefId
source§fn clone(&self) -> ResolvedDefId
fn clone(&self) -> ResolvedDefId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl Copy for ResolvedDefId
Auto Trait Implementations§
impl Freeze for ResolvedDefId
impl RefUnwindSafe for ResolvedDefId
impl Send for ResolvedDefId
impl Sync for ResolvedDefId
impl Unpin for ResolvedDefId
impl UnwindSafe for ResolvedDefId
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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