Struct syntax_ext::format_foreign::printf::Format [−][src]
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: (usize, usize),
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A single printf-style formatting directive.
Fields
span: &'a str
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The entire original formatting directive.
parameter: Option<u16>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The (1-based) parameter to be converted.
flags: &'a str
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Formatting flags.
width: Option<Num>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Minimum width of the output.
precision: Option<Num>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Precision of the conversion.
length: Option<&'a str>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Length modifier for the conversion.
type_: &'a str
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Type of parameter being converted.
position: (usize, usize)
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Byte offset for the start and end of this formatting directive.
Methods
impl<'a> Format<'a>[src]
impl<'a> Format<'a>pub fn translate(&self) -> Option<String>[src]
pub fn translate(&self) -> Option<String>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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> Clone for Format<'a>fn clone(&self) -> Format<'a>[src]
fn clone(&self) -> Format<'a>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'a> PartialEq for Format<'a>[src]
impl<'a> PartialEq for Format<'a>fn eq(&self, other: &Format<'a>) -> bool[src]
fn eq(&self, other: &Format<'a>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Format<'a>) -> bool[src]
fn ne(&self, other: &Format<'a>) -> boolThis method tests for !=.
impl<'a> Debug for Format<'a>[src]
impl<'a> Debug for Format<'a>