pub enum MaybeExternId<Id = LocalDefId> {
    Local(Id),
    Extern(Id, DefId),
}Expand description
This enum serves as a type-level reminder that a local definition may be a wrapper for an extern spec. This abstraction is not infallible, so one should be careful and decide in each situation whether to use the local id or the resolved id.
The construction of MaybeExternId is not encapsulated, but it is recommended to use
GlobalEnv::maybe_extern_id to create one.
The enum is generic on the local Id as we use it with various kinds of local ids, e.g.,
LocalDefId, DefId, …
Variants§
Local(Id)
An id for a local spec.
Extern(Id, DefId)
A “dummy” local definition wrapping an external spec. The Id is the local id of the definition
corresponding to the extern spec. The DefId is the resolved id for the external definition.
Implementations§
Trait Implementations§
Source§impl<Id: Clone> Clone for MaybeExternId<Id>
 
impl<Id: Clone> Clone for MaybeExternId<Id>
Source§fn clone(&self) -> MaybeExternId<Id>
 
fn clone(&self) -> MaybeExternId<Id>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl<Id: Debug> Debug for MaybeExternId<Id>
 
impl<Id: Debug> Debug for MaybeExternId<Id>
Source§impl IntoQueryParam<DefId> for MaybeExternId
 
impl IntoQueryParam<DefId> for MaybeExternId
fn into_query_param(self) -> DefId
impl<Id: Copy> Copy for MaybeExternId<Id>
Auto Trait Implementations§
impl<Id> Freeze for MaybeExternId<Id>where
    Id: Freeze,
impl<Id> RefUnwindSafe for MaybeExternId<Id>where
    Id: RefUnwindSafe,
impl<Id> Send for MaybeExternId<Id>where
    Id: Send,
impl<Id> Sync for MaybeExternId<Id>where
    Id: Sync,
impl<Id> Unpin for MaybeExternId<Id>where
    Id: Unpin,
impl<Id> UnwindSafe for MaybeExternId<Id>where
    Id: UnwindSafe,
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
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>
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 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>
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