Trait quote::IdentFragment

source ·
pub trait IdentFragment {
    // Required method
    fn fmt(&self, f: &mut Formatter<'_>) -> Result;

    // Provided method
    fn span(&self) -> Option<Span> { ... }
}
Expand description

Specialized formatting trait used by format_ident!.

Ident arguments formatted using this trait will have their r# prefix stripped, if present.

See format_ident! for more information.

Required Methods§

source

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Format this value as an identifier fragment.

Provided Methods§

source

fn span(&self) -> Option<Span>

Span associated with this IdentFragment.

If non-None, may be inherited by formatted identifiers.

Implementations on Foreign Types§

source§

impl IdentFragment for bool

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for char

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for str

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u8

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u32

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u128

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for usize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for Ident

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T> IdentFragment for Cow<'_, T>
where T: IdentFragment + ToOwned + ?Sized,

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T: IdentFragment + ?Sized> IdentFragment for &T

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T: IdentFragment + ?Sized> IdentFragment for &mut T

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Implementors§