pub enum ParseMode {
Named(Span),
Unnamed,
}
Expand description
The context a meta item parser is operating in.
Variants§
Named(Span)
Named context, corresponding to syn::FieldsNamed
.
Contains the Span
of the name tokens.
Unnamed
Unnamed context, corresponding to syn::FieldsUnnamed
.
Implementations§
Source§impl ParseMode
impl ParseMode
Sourcepub fn to_named(&self, input: ParseStream<'_>) -> Self
pub fn to_named(&self, input: ParseStream<'_>) -> Self
Converts self
to a Self::Named
.
Sourcepub fn named_span(&self) -> Option<Span>
pub fn named_span(&self) -> Option<Span>
Sourcepub fn to_span(&self, input: ParseStream<'_>) -> Span
pub fn to_span(&self, input: ParseStream<'_>) -> Span
Sourcepub fn to_full_span<'s, S: Borrow<ParseBuffer<'s>>>(&self, inputs: &[S]) -> Span
pub fn to_full_span<'s, S: Borrow<ParseBuffer<'s>>>(&self, inputs: &[S]) -> Span
Gets the stored Span
.
If self
is Unnamed
, returns inputs_span(inputs)
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParseMode
impl RefUnwindSafe for ParseMode
impl !Send for ParseMode
impl !Sync for ParseMode
impl Unpin for ParseMode
impl UnwindSafe for ParseMode
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