Available on crate feature
formatting only.Expand description
Formatting for various types.
Re-exportsยง
pub use self::formattable::Formattable;
Modulesยง
- component_
provider ๐ - formattable ๐
- A trait that can be used to format an item from its components.
- iso8601 ๐
- Helpers for implementing formatting for ISO 8601.
- metadata ๐
Constantsยง
- MONTH_
NAMES ๐ - WEEKDAY_
NAMES ๐
Functionsยง
- f64_
10_ ๐pow_ x - Helper function to obtain 10^x, guaranteeing determinism for x โค 9. For these cases, the
function optimizes to a lookup table. For x โฅ 10, it falls back to
10_f64.powi(x). The only situation where this would occur is if the user explicitly requests such precision when configuring the ISO 8601 well known format. All other possibilities max out at nine digits. - fmt_
calendar_ ๐year_ century_ extended_ range - fmt_
calendar_ ๐year_ century_ standard_ range - fmt_
calendar_ ๐year_ full_ extended_ range - fmt_
calendar_ ๐year_ full_ standard_ range - fmt_
calendar_ ๐year_ last_ two - fmt_
century ๐Deprecated - Format the century into the designated output. Requires the full year be provided as an argument.
- fmt_day ๐
- Format the day into the designated output.
- fmt_
full_ ๐year Deprecated - Format the full year into the designated output.
- fmt_
hour_ ๐12 - Format the hour into the designated output using the 12-hour clock.
- fmt_
hour_ ๐24 - Format the hour into the designated output using the 24-hour clock.
- fmt_
iso_ ๐year_ century_ extended_ range - fmt_
iso_ ๐year_ century_ standard_ range - fmt_
iso_ ๐year_ full_ extended_ range - fmt_
iso_ ๐year_ full_ standard_ range - fmt_
iso_ ๐year_ last_ two - fmt_
minute ๐ - Format the minute into the designated output.
- fmt_
month_ ๐long - Format the month into the designated output using the full name.
- fmt_
month_ ๐numerical - Format the month into the designated output as a number from 1-12.
- fmt_
month_ ๐short - Format the month into the designated output using the abbreviated name.
- fmt_
offset_ ๐hour - Format the offset hour into the designated output.
- fmt_
offset_ ๐minute - Format the offset minute into the designated output.
- fmt_
offset_ ๐second - Format the offset second into the designated output.
- fmt_
ordinal ๐ - Format the ordinal into the designated output.
- fmt_
period ๐ - Format the period into the designated output.
- fmt_
second ๐ - Format the second into the designated output.
- fmt_
sign ๐ - fmt_
subsecond ๐ - Format the subsecond into the designated output.
- fmt_
unix_ ๐timestamp_ microsecond - Format the Unix timestamp (in microseconds) into the designated output.
- fmt_
unix_ ๐timestamp_ millisecond - Format the Unix timestamp (in milliseconds) into the designated output.
- fmt_
unix_ ๐timestamp_ nanosecond - Format the Unix timestamp (in nanoseconds) into the designated output.
- fmt_
unix_ ๐timestamp_ second - Format the Unix timestamp (in seconds) into the designated output.
- fmt_
week_ ๐number Deprecated - Format the week number into the designated output.
- fmt_
week_ ๐number_ iso - fmt_
week_ ๐number_ monday - fmt_
week_ ๐number_ sunday - fmt_
weekday_ ๐long - Format the weekday into the designated output using the full name.
- fmt_
weekday_ ๐monday - Format the weekday into the designated output as a number from either 0-6 or 1-7 (depending on the modifier), where Monday is either 0 or 1.
- fmt_
weekday_ ๐short - Format the weekday into the designated output using the abbreviated name.
- fmt_
weekday_ ๐sunday - Format the weekday into the designated output as a number from either 0-6 or 1-7 (depending on the modifier), where Sunday is either 0 or 1.
- fmt_
year_ ๐last_ two Deprecated - format_
component ๐ - Format the provided component into the designated output. An
Errwill be returned if the component requires information that it does not provide or if the value cannot be output to the stream. - format_
five_ ๐digits_ pad_ zero - Format a five digit number that is padded with zeroes.
- format_
float ๐ - Write the floating point number to the output, returning the number of bytes written.
- format_
four_ ๐digits - Format a four digit number with the specified padding.
- format_
four_ ๐digits_ pad_ zero - Format a four digit number that is padded with zeroes.
- format_
number_ ๐pad_ none - Format a number with no padding.
- format_
single_ ๐digit - Format a single digit.
- format_
six_ ๐digits_ pad_ zero - Format a six digit number that is padded with zeroes.
- format_
three_ ๐digits - Format a three digit number with the specified padding.
- format_
two_ ๐digits - Format a two digit number with the specified padding.
- write ๐
- Write the string to the output, returning the number of bytes written.
- write_
bytes ๐ - Write all bytes to the output, returning the number of bytes written.
- write_
if ๐ - If
predis true, write the string to the output, returning the number of bytes written. - write_
if_ ๐else - If
predis true, writetrue_strto the output. Otherwise, writefalse_str. - write_
many ๐ - Write all strings to the output (in order), returning the total number of bytes written.
Type Aliasesยง
- AnyWeek
Number ๐ - Day ๐
- Extended
Century ๐ - IsoWeek
Number ๐ - LastTwo ๐
- Monday
Based ๐Week - Option
Day ๐ - Option
IsoWeek ๐Number - Option
Year ๐ - Ordinal ๐
- Standard
Century ๐ - Standard
Year ๐ - Sunday
Based ๐Week - Year ๐