| 1 | //! Part of a format description. |
| 2 | |
| 3 | use crate::format_description::modifier; |
| 4 | |
| 5 | /// A component of a larger format description. |
| 6 | #[non_exhaustive ] |
| 7 | #[derive (Debug, Clone, Copy, PartialEq, Eq)] |
| 8 | pub enum Component { |
| 9 | /// Day of the month. |
| 10 | Day(modifier::Day), |
| 11 | /// Month of the year. |
| 12 | Month(modifier::Month), |
| 13 | /// Ordinal day of the year. |
| 14 | Ordinal(modifier::Ordinal), |
| 15 | /// Day of the week. |
| 16 | Weekday(modifier::Weekday), |
| 17 | /// Week within the year. |
| 18 | WeekNumber(modifier::WeekNumber), |
| 19 | /// Year of the date. |
| 20 | Year(modifier::Year), |
| 21 | /// Hour of the day. |
| 22 | Hour(modifier::Hour), |
| 23 | /// Minute within the hour. |
| 24 | Minute(modifier::Minute), |
| 25 | /// AM/PM part of the time. |
| 26 | Period(modifier::Period), |
| 27 | /// Second within the minute. |
| 28 | Second(modifier::Second), |
| 29 | /// Subsecond within the second. |
| 30 | Subsecond(modifier::Subsecond), |
| 31 | /// Hour of the UTC offset. |
| 32 | OffsetHour(modifier::OffsetHour), |
| 33 | /// Minute within the hour of the UTC offset. |
| 34 | OffsetMinute(modifier::OffsetMinute), |
| 35 | /// Second within the minute of the UTC offset. |
| 36 | OffsetSecond(modifier::OffsetSecond), |
| 37 | /// A number of bytes to ignore when parsing. This has no effect on formatting. |
| 38 | Ignore(modifier::Ignore), |
| 39 | /// A Unix timestamp. |
| 40 | UnixTimestamp(modifier::UnixTimestamp), |
| 41 | /// The end of input. Parsing this component will fail if there is any input remaining. This |
| 42 | /// component neither affects formatting nor consumes any input when parsing. |
| 43 | End(modifier::End), |
| 44 | } |
| 45 | |