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)
e.g., $($foo: expr),*
Tuple Fields
§
1: Vec<ParsedMacroArg>
Inner arguments inside delimiters.
§
2: Option<Box<ParsedMacroArg>>
Something after the closing delimiter and the repeat token, if available.
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 Freeze for MacroArgKind
impl !RefUnwindSafe for MacroArgKind
impl !Send for MacroArgKind
impl !Sync for MacroArgKind
impl Unpin for MacroArgKind
impl !UnwindSafe for MacroArgKind
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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
: 40 bytesRepeat
: 64 bytesDelimited
: 40 bytesSeparator
: 56 bytesOther
: 56 bytes