Enum rustc_expand::mbe::metavar_expr::MetaVarExpr
source · pub(crate) enum MetaVarExpr {
Count(Ident, Option<usize>),
Ignore(Ident),
Index(usize),
Length(usize),
}
Expand description
A meta-variable expression, for expansions based on properties of meta-variables.
Variants§
Count(Ident, Option<usize>)
The number of repetitions of an identifier, optionally limited to a number
of outer-most repetition depths. If the depth limit is None
then the depth is unlimited.
Ignore(Ident)
Ignore a meta-variable for repetition without expansion.
Index(usize)
The index of the repetition at a particular depth, where 0 is the inner-most
repetition. The usize
is the depth.
Length(usize)
The length of the repetition at a particular depth, where 0 is the inner-most
repetition. The usize
is the depth.
Implementations§
source§impl MetaVarExpr
impl MetaVarExpr
Trait Implementations§
source§impl Clone for MetaVarExpr
impl Clone for MetaVarExpr
source§fn clone(&self) -> MetaVarExpr
fn clone(&self) -> MetaVarExpr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetaVarExpr
impl Debug for MetaVarExpr
source§impl<__D: Decoder> Decodable<__D> for MetaVarExpr
impl<__D: Decoder> Decodable<__D> for MetaVarExpr
source§impl<__E: Encoder> Encodable<__E> for MetaVarExpr
impl<__E: Encoder> Encodable<__E> for MetaVarExpr
source§impl PartialEq<MetaVarExpr> for MetaVarExpr
impl PartialEq<MetaVarExpr> for MetaVarExpr
source§fn eq(&self, other: &MetaVarExpr) -> bool
fn eq(&self, other: &MetaVarExpr) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for MetaVarExpr
Auto Trait Implementations§
impl RefUnwindSafe for MetaVarExpr
impl !Send for MetaVarExpr
impl !Sync for MetaVarExpr
impl Unpin for MetaVarExpr
impl UnwindSafe for MetaVarExpr
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
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: 32 bytes
Size for each variant:
Count
: 32 bytesIgnore
: 20 bytesIndex
: 16 bytesLength
: 16 bytes