[−][src]Enum rustc_builtin_macros::format_foreign::printf::Substitution

pub enum Substitution<'a> {
    Format(Format<'a>),
    Escape,
}

Represents a single printf-style substitution.

Variants

Format(Format<'a>)

A formatted output substitution with its internal byte offset.

Escape

A literal %% escape.

Implementations

impl<'a> Substitution<'a>[src]

pub fn as_str(&self) -> &str[src]

pub fn position(&self) -> Option<InnerSpan>[src]

pub fn set_position(&mut self, start: usize, end: usize)[src]

pub fn translate(&self) -> Option<String>[src]

Translate this substitution into an equivalent Rust formatting directive.

This ignores cases where the substitution does not have an exact equivalent, or where the substitution would be unnecessary.

Trait Implementations

impl<'a> Clone for Substitution<'a>[src]

impl<'a> Debug for Substitution<'a>[src]

impl<'a> PartialEq<Substitution<'a>> for Substitution<'a>[src]

impl<'a> StructuralPartialEq for Substitution<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Substitution<'a>

impl<'a> Send for Substitution<'a>

impl<'a> Sync for Substitution<'a>

impl<'a> Unpin for Substitution<'a>

impl<'a> UnwindSafe for Substitution<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.