pub enum Token {
Ident(Ident),
Literal(LitStr),
}Expand description
Represents either Ident or LitStr token.
Used when macro need a simple interface for input, and user can decide a way to provide string.
Example:
#[token_goblin::munch]
fn foo(input: Token) -> TokenStream {
output_str!("{}", input.to_string());
}
foo!("foo");
// -> fooVariants§
Trait Implementations§
Auto Trait Implementations§
impl !Send for Token
impl !Sync for Token
impl Freeze for Token
impl RefUnwindSafe for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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