[−][src]Struct rustc_builtin_macros::format_foreign::printf::Format

pub struct Format<'a> {
    pub span: &'a str,
    pub parameter: Option<u16>,
    pub flags: &'a str,
    pub width: Option<Num>,
    pub precision: Option<Num>,
    pub length: Option<&'a str>,
    pub type_: &'a str,
    pub position: InnerSpan,
}

A single printf-style formatting directive.

Fields

span: &'a str

The entire original formatting directive.

parameter: Option<u16>

The (1-based) parameter to be converted.

flags: &'a str

Formatting flags.

width: Option<Num>

Minimum width of the output.

precision: Option<Num>

Precision of the conversion.

length: Option<&'a str>

Length modifier for the conversion.

type_: &'a str

Type of parameter being converted.

position: InnerSpan

Byte offset for the start and end of this formatting directive.

Implementations

impl<'_> Format<'_>[src]

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

Translate this directive into an equivalent Rust formatting directive.

Returns None in cases where the printf directive does not have an exact Rust equivalent, rather than guessing.

Trait Implementations

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

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

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

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for Format<'a>

impl<'a> Send for Format<'a>

impl<'a> Sync for Format<'a>

impl<'a> Unpin for Format<'a>

impl<'a> UnwindSafe for Format<'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.