pub struct SingletonRef {
pub hash: Pound,
pub access_group: Option<(Brace, LitInt)>,
pub token_mut: Option<Mut>,
pub ident: Ident,
}Expand description
A parsed singleton reference token with mutability and optional access group.
Syntax: #var, #mut var, #{N} var, #{N} mut var
Fields§
§hash: PoundHash # marking the start of the singleton.
access_group: Option<(Brace, LitInt)>Optional access group for ordering (#{N} prefix). Stores the brace group and parsed integer.
token_mut: Option<Mut>Whether this is a mutable reference (#mut var or #{N} mut var).
ident: IdentThe variable name being referenced.
Implementations§
Source§impl SingletonRef
impl SingletonRef
Sourcepub fn try_parse(input: ParseStream<'_>) -> Result<(Option<Self>, TokenStream)>
pub fn try_parse(input: ParseStream<'_>) -> Result<(Option<Self>, TokenStream)>
Returns a parsed singleton reference token (if valid) and all remaining tokens.
Trait Implementations§
Source§impl Clone for SingletonRef
impl Clone for SingletonRef
Source§fn clone(&self) -> SingletonRef
fn clone(&self) -> SingletonRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SingletonRef
impl Debug for SingletonRef
Source§impl Parse for SingletonRef
impl Parse for SingletonRef
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl ToTokens for SingletonRef
impl ToTokens for SingletonRef
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl !Send for SingletonRef
impl !Sync for SingletonRef
impl Freeze for SingletonRef
impl RefUnwindSafe for SingletonRef
impl Unpin for SingletonRef
impl UnsafeUnpin for SingletonRef
impl UnwindSafe for SingletonRef
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§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> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.