Trait Punct

Source
pub trait Punct: ProcMacro<Punct = Self> + Display {
    // Required methods
    fn new(ch: char, spacing: Self::Spacing) -> Self;
    fn as_char(&self) -> char;
    fn spacing(&self) -> Self::Spacing;
    fn span(&self) -> Self::Span;
    fn set_span(&mut self, span: Self::Span);
}
Expand description

Punct API trait. See proc_macro::Punct.

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

See also PunctExt.

Required Methods§

Source

fn new(ch: char, spacing: Self::Spacing) -> Self

Create a new Punct.

Source

fn as_char(&self) -> char

The value of this Punct as a char

Source

fn spacing(&self) -> Self::Spacing

The Spacing of this Punct.

Source

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

The span of this Punct.

Source

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

Set the span of this Punct.

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 Punct for Punct

Available on crate feature proc-macro only.
Source§

fn new(ch: char, spacing: Self::Spacing) -> Self

Source§

fn as_char(&self) -> char

Source§

fn spacing(&self) -> Self::Spacing

Source§

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

Source§

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

Source§

impl Punct for Punct

Available on crate feature proc-macro2 only.
Source§

fn new(ch: char, spacing: Self::Spacing) -> Self

Source§

fn as_char(&self) -> char

Source§

fn spacing(&self) -> Self::Spacing

Source§

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

Source§

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

Implementors§