Skip to main content

Module formatting

Module formatting 

Source
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 Err will 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 pred is true, write the string to the output, returning the number of bytes written.
write_if_else ๐Ÿ”’
If pred is true, write true_str to the output. Otherwise, write false_str.
write_many ๐Ÿ”’
Write all strings to the output (in order), returning the total number of bytes written.

Type Aliasesยง

AnyWeekNumber ๐Ÿ”’
Day ๐Ÿ”’
ExtendedCentury ๐Ÿ”’
IsoWeekNumber ๐Ÿ”’
LastTwo ๐Ÿ”’
MondayBasedWeek ๐Ÿ”’
OptionDay ๐Ÿ”’
OptionIsoWeekNumber ๐Ÿ”’
OptionYear ๐Ÿ”’
Ordinal ๐Ÿ”’
StandardCentury ๐Ÿ”’
StandardYear ๐Ÿ”’
SundayBasedWeek ๐Ÿ”’
Year ๐Ÿ”’