Trait Ident

Source
pub trait Ident: ProcMacro<Ident = Self> + Display {
    // Required methods
    fn new(string: &str, span: Self::Span) -> Self;
    fn new_raw(string: &str, span: Self::Span) -> Self;
    fn span(&self) -> Self::Span;
    fn set_span(&mut self, span: Self::Span);
}
Expand description

Ident API trait. See proc_macro::Ident.

This trait is implemented for Ident in proc_macro and proc_macro2 if the corresponding feature is enabled.

See also IdentExt.

Required Methods§

Source

fn new(string: &str, span: Self::Span) -> Self

Create a new Ident with the specified span.

Source

fn new_raw(string: &str, span: Self::Span) -> Self

Create a new raw identifier with the specified span.

Source

fn span(&self) -> Self::Span

The span of this Ident.

Source

fn set_span(&mut self, span: Self::Span)

Set the span of this Ident.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Ident for Ident

Available on crate feature proc-macro only.
Source§

fn new(string: &str, span: Self::Span) -> Self

Source§

fn new_raw(string: &str, span: Self::Span) -> Self

Source§

fn span(&self) -> Self::Span

Source§

fn set_span(&mut self, span: Self::Span)

Source§

impl Ident for Ident

Available on crate feature proc-macro2 only.
Source§

fn new(string: &str, span: Self::Span) -> Self

Source§

fn new_raw(string: &str, span: Self::Span) -> Self

Source§

fn span(&self) -> Self::Span

Source§

fn set_span(&mut self, span: Self::Span)

Implementors§