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 | |
10 | mod borrowed_format_item; |
11 | mod component; |
12 | pub mod modifier; |
13 | #[cfg (feature = "alloc" )] |
14 | mod owned_format_item; |
15 | #[cfg (feature = "alloc" )] |
16 | mod parse; |
17 | |
18 | pub use borrowed_format_item::BorrowedFormatItem as FormatItem; |
19 | #[cfg (feature = "alloc" )] |
20 | pub use owned_format_item::OwnedFormatItem; |
21 | |
22 | pub use self::component::Component; |
23 | #[cfg (feature = "alloc" )] |
24 | pub use self::parse::{parse, parse_borrowed, parse_owned}; |
25 | |
26 | /// Well-known formats, typically standards. |
27 | pub mod well_known { |
28 | pub mod iso8601; |
29 | mod rfc2822; |
30 | mod rfc3339; |
31 | |
32 | #[doc (inline)] |
33 | pub use iso8601::Iso8601; |
34 | pub use rfc2822::Rfc2822; |
35 | pub use rfc3339::Rfc3339; |
36 | } |
37 | |