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
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 DynSend for LocalExpnId
impl DynSync for LocalExpnId
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> Pointable for T
impl<T> Pointable for T
Source§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