pub struct LocalExpnId {
private_use_as_methods_instead: u32,
}
Expand description
A unique ID associated with a macro invocation and expansion.
Fields§
§private_use_as_methods_instead: u32
Implementations§
source§impl LocalExpnId
impl LocalExpnId
sourcepub const MAX_AS_U32: u32 = 4_294_967_040u32
pub const MAX_AS_U32: u32 = 4_294_967_040u32
Maximum value the index can take, as a u32
.
sourcepub const fn from_usize(value: usize) -> Self
pub const fn from_usize(value: usize) -> Self
sourcepub const unsafe fn from_u32_unchecked(value: u32) -> Self
pub const unsafe fn from_u32_unchecked(value: u32) -> Self
Creates a new index from a given u32
.
§Safety
The provided value must be less than or equal to the maximum value for the newtype. Providing a value outside this range is undefined due to layout restrictions.
Prefer using from_u32
.
source§impl LocalExpnId
impl LocalExpnId
sourcepub const ROOT: LocalExpnId = LocalExpnId::ZERO
pub const ROOT: LocalExpnId = LocalExpnId::ZERO
The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
fn from_raw(idx: ExpnIndex) -> LocalExpnId
pub fn as_raw(self) -> ExpnIndex
pub fn fresh_empty() -> LocalExpnId
pub fn fresh(expn_data: ExpnData, ctx: impl HashStableContext) -> LocalExpnId
pub fn expn_data(self) -> ExpnData
pub fn to_expn_id(self) -> ExpnId
pub fn set_expn_data(self, expn_data: ExpnData, ctx: impl HashStableContext)
pub fn is_descendant_of(self, ancestor: LocalExpnId) -> bool
sourcepub fn expansion_cause(self) -> Option<Span>
pub fn expansion_cause(self) -> Option<Span>
Returns span for the macro which originally caused this expansion to happen.
Stops backtracing at include! boundary.
Trait Implementations§
source§impl Add<usize> for LocalExpnId
impl Add<usize> for LocalExpnId
source§impl Clone for LocalExpnId
impl Clone for LocalExpnId
source§fn clone(&self) -> LocalExpnId
fn clone(&self) -> LocalExpnId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LocalExpnId
impl Debug for LocalExpnId
source§impl<D: SpanDecoder> Decodable<D> for LocalExpnId
impl<D: SpanDecoder> Decodable<D> for LocalExpnId
source§impl<E: SpanEncoder> Encodable<E> for LocalExpnId
impl<E: SpanEncoder> Encodable<E> for LocalExpnId
source§impl From<LocalExpnId> for u32
impl From<LocalExpnId> for u32
source§fn from(v: LocalExpnId) -> u32
fn from(v: LocalExpnId) -> u32
source§impl From<LocalExpnId> for usize
impl From<LocalExpnId> for usize
source§fn from(v: LocalExpnId) -> usize
fn from(v: LocalExpnId) -> usize
source§impl From<u32> for LocalExpnId
impl From<u32> for LocalExpnId
source§impl From<usize> for LocalExpnId
impl From<usize> for LocalExpnId
source§impl Hash for LocalExpnId
impl Hash for LocalExpnId
source§impl Idx for LocalExpnId
impl Idx for LocalExpnId
source§impl PartialEq for LocalExpnId
impl PartialEq for LocalExpnId
impl Copy for LocalExpnId
impl Eq for LocalExpnId
impl !Ord for LocalExpnId
impl !PartialOrd for LocalExpnId
impl StructuralPartialEq for LocalExpnId
Auto Trait Implementations§
impl Freeze for LocalExpnId
impl RefUnwindSafe for LocalExpnId
impl Send for LocalExpnId
impl Sync for LocalExpnId
impl Unpin for LocalExpnId
impl UnwindSafe for LocalExpnId
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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 moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes