pub trait Fmt {
fn format(
&self,
full_name: &[String],
name: &[String],
args: &[String],
flags: &[char],
options: &HashMap<String, String>
) -> Result<String, SingleFmtError>;
}
Expand description
A unit of formatting.
Required Methods
sourcefn format(
&self,
full_name: &[String],
name: &[String],
args: &[String],
flags: &[char],
options: &HashMap<String, String>
) -> Result<String, SingleFmtError>
fn format(
&self,
full_name: &[String],
name: &[String],
args: &[String],
flags: &[char],
options: &HashMap<String, String>
) -> Result<String, SingleFmtError>
Perform the formatting of a single placeholder. Placeholder’s full name, name segments of child format units, arguments, flags and options will be passed to this method.
You should not use this method directly, use format
on FormatTable
instead.
Implementations on Foreign Types
sourceimpl Fmt for bool
impl Fmt for bool
This instance is aware of the following flags:
y
, which changes the output from true/false to yes/no;Y
, which changes the output to Y/N.
Common options are recognized.
sourceimpl Fmt for f32
impl Fmt for f32
This instance is aware of the following flags:
+
, which forces display of the sign;e
, which changes the output to the scientific, or exponential, notation.
Common options are recognized. Common numeric options are also recognized.
sourceimpl Fmt for f64
impl Fmt for f64
This instance is aware of the following flags:
+
, which forces display of the sign;e
, which changes the output to scientific format.
Common options are recognized. Common numeric options are also recognized.
sourceimpl Fmt for i8
impl Fmt for i8
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for i16
impl Fmt for i16
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for i32
impl Fmt for i32
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for i64
impl Fmt for i64
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for i128
impl Fmt for i128
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for isize
impl Fmt for isize
This instance is aware of the following flags:
+
, which forces display of the sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes output hexadecimal;
Common and common numeric options are recognized.
sourceimpl Fmt for u8
impl Fmt for u8
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.
sourceimpl Fmt for u16
impl Fmt for u16
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.
sourceimpl Fmt for u32
impl Fmt for u32
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.
sourceimpl Fmt for u64
impl Fmt for u64
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.
sourceimpl Fmt for u128
impl Fmt for u128
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.
sourceimpl Fmt for usize
impl Fmt for usize
This instance is aware of the following flags:
+
, which add a leading plus sign;b
, which makes the output binary;o
, which makes the output octal;p
, which in combination with ‘b
’, ‘o
’ or ‘x
’ adds a base prefix to the output.x
, which makes the output hexadecimal.
Common and common numeric options are recognized.