time/format_description/mod.rs
1//! Description of how types should be formatted and parsed.
2//!
3//! The formatted value will be output to the provided writer. Format descriptions can be
4//! [well-known](crate::format_description::well_known) or obtained by using the
5//! [`format_description!`](crate::macros::format_description) macro or a function listed below.
6//!
7//! For examples, see the implementors of [Formattable](crate::formatting::Formattable),
8//! e.g. [`well_known::Rfc3339`].
9
10mod borrowed_format_item;
11mod component;
12pub mod modifier;
13#[cfg(feature = "alloc")]
14mod owned_format_item;
15#[cfg(feature = "alloc")]
16mod parse;
17
18pub use borrowed_format_item::BorrowedFormatItem;
19#[doc(hidden)]
20#[deprecated(since = "0.3.37", note = "use `BorrowedFormatItem` for clarity")]
21pub use borrowed_format_item::BorrowedFormatItem as FormatItem;
22#[cfg(feature = "alloc")]
23pub use owned_format_item::OwnedFormatItem;
24
25pub use self::component::Component;
26#[cfg(feature = "alloc")]
27pub use self::parse::{
28 parse, parse_borrowed, parse_owned, parse_strftime_borrowed, parse_strftime_owned,
29};
30
31/// The type output by the [`format_description!`](crate::macros::format_description) macro.
32pub type StaticFormatDescription = &'static [BorrowedFormatItem<'static>];
33
34/// Well-known formats, typically standards.
35pub mod well_known {
36 pub mod iso8601;
37 mod rfc2822;
38 mod rfc3339;
39
40 #[doc(inline)]
41 pub use iso8601::Iso8601;
42 pub use rfc2822::Rfc2822;
43 pub use rfc3339::Rfc3339;
44}