pub enum Delimiter {
Parenthesis,
Brace,
Bracket,
Invisible,
}
Expand description
Describes how a sequence of token trees is delimited.
Cannot use proc_macro::Delimiter
directly because this
structure should implement some additional traits.
The None
variant is also renamed to Invisible
to be
less confusing and better convey the semantics.
Variants§
Parenthesis
( ... )
Brace
{ ... }
Bracket
[ ... ]
Invisible
Ø ... Ø
An invisible delimiter, that may, for example, appear around tokens coming from a
“macro variable” $var
. It is important to preserve operator priorities in cases like
$var * 3
where $var
is 1 + 2
.
Invisible delimiters might not survive roundtrip of a token stream through a string.
Trait Implementations§
source§impl<__CTX> HashStable<__CTX> for Delimiterwhere
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for Delimiterwhere
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
impl Copy for Delimiter
impl Eq for Delimiter
impl StructuralEq for Delimiter
impl StructuralPartialEq for Delimiter
Auto Trait Implementations§
impl RefUnwindSafe for Delimiter
impl Send for Delimiter
impl Sync for Delimiter
impl Unpin for Delimiter
impl UnwindSafe for Delimiter
Blanket Implementations§
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: 1 byte
Size for each variant:
Parenthesis
: 0 bytesBrace
: 0 bytesBracket
: 0 bytesInvisible
: 0 bytes