Enum rustfmt_nightly::macros::MacroArgKind
source · [−]enum MacroArgKind {
MetaVariable(Symbol, String),
Repeat(DelimToken, Vec<ParsedMacroArg>, Option<Box<ParsedMacroArg>>, Token),
Delimited(DelimToken, Vec<ParsedMacroArg>),
Separator(String, String),
Other(String, String),
}Variants
MetaVariable(Symbol, String)
e.g., $x: expr.
Repeat(DelimToken, Vec<ParsedMacroArg>, Option<Box<ParsedMacroArg>>, Token)
Tuple Fields
0: DelimToken(), [] or {}.
1: Vec<ParsedMacroArg>Inner arguments inside delimiters.
2: Option<Box<ParsedMacroArg>>Something after the closing delimiter and the repeat token, if available.
3: TokenThe repeat token. This could be one of *, + or ?.
e.g., $($foo: expr),*
Delimited(DelimToken, 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 more
Auto 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. 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