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
0: Delimiter
()
, []
or {}
.
1: Vec<ParsedMacroArg>
Inner arguments inside delimiters.
2: Option<Box<ParsedMacroArg>>
Something after the closing delimiter and the repeat token, if available.
3: Token
The repeat token. This could be one of *
, +
or ?
.
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
sourceimpl 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
sourceimpl Clone for MacroArgKind
impl Clone for MacroArgKind
sourcefn clone(&self) -> MacroArgKind
fn clone(&self) -> MacroArgKind
Returns a copy of the value. Read more
1.0.0 · sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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