Trait quote_use::IdentFragment

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

    // 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<(), Error>

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<(), Error>

source§

impl IdentFragment for char

source§

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

source§

impl IdentFragment for str

source§

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

source§

impl IdentFragment for u8

source§

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

source§

impl IdentFragment for u16

source§

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

source§

impl IdentFragment for u32

source§

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

source§

impl IdentFragment for u64

source§

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

source§

impl IdentFragment for u128

source§

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

source§

impl IdentFragment for usize

source§

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

source§

impl IdentFragment for String

source§

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

source§

impl IdentFragment for Ident

source§

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

source§

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

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<(), Error>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§