Enum rustfmt_nightly::macros::MacroArgKind
source · enum MacroArgKind {
MetaVariable(Symbol, String),
Repeat(Delimiter, Vec<ParsedMacroArg>, Option<Box<ParsedMacroArg>>, Token),
Delimited(Delimiter, Vec<ParsedMacroArg>),
Separator(String, String),
Other(String, String),
}
Variants§
MetaVariable(Symbol, String)
e.g., $x: expr
.
Repeat(Delimiter, Vec<ParsedMacroArg>, Option<Box<ParsedMacroArg>>, Token)
Tuple Fields
§
1: Vec<ParsedMacroArg>
Inner arguments inside delimiters.
§
2: Option<Box<ParsedMacroArg>>
Something after the closing delimiter and the repeat token, if available.
e.g., $($foo: expr),*
Delimited(Delimiter, Vec<ParsedMacroArg>)
e.g., [derive(Debug)]
Separator(String, String)
A possible separator. e.g., ,
or ;
.
Other(String, String)
Other random stuff that does not fit to other kinds.
e.g., == foo
in ($x: expr == foo)
.
Implementations§
source§impl MacroArgKind
impl MacroArgKind
fn starts_with_brace(&self) -> bool
fn starts_with_dollar(&self) -> bool
fn ends_with_space(&self) -> bool
fn has_meta_var(&self) -> bool
fn rewrite(
&self,
context: &RewriteContext<'_>,
shape: Shape,
use_multiple_lines: bool
) -> Option<String>
Trait Implementations§
source§impl Clone for MacroArgKind
impl Clone for MacroArgKind
source§fn clone(&self) -> MacroArgKind
fn clone(&self) -> MacroArgKind
Returns a copy 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 moreAuto Trait Implementations§
impl !RefUnwindSafe for MacroArgKind
impl !Send for MacroArgKind
impl !Sync for MacroArgKind
impl Unpin for MacroArgKind
impl !UnwindSafe for MacroArgKind
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: 64 bytes
Size for each variant:
MetaVariable
: 31 bytesRepeat
: 63 bytesDelimited
: 31 bytesSeparator
: 55 bytesOther
: 55 bytes