1//! Various modifiers for components.
23use core::num::NonZero;
45/// Generate the provided code if and only if `pub` is present.
6macro_rules! if_pub {
7 (pub $(#[$attr:meta])*; $($x:tt)*) => {
8 $(#[$attr])*
9///
10 /// This function exists since [`Default::default()`] cannot be used in a `const` context.
11 /// It may be removed once that becomes possible. As the [`Default`] trait is in the
12 /// prelude, removing this function in the future will not cause any resolution failures for
13 /// the overwhelming majority of users; only users who use `#![no_implicit_prelude]` will be
14 /// affected. As such it will not be considered a breaking change.
15$($x)*
16 };
17 ($($_:tt)*) => {};
18}
1920/// Implement `Default` for the given type. This also generates an inherent implementation of a
21/// `default` method that is `const fn`, permitting the default value to be used in const contexts.
22// Every modifier should use this macro rather than a derived `Default`.
23macro_rules! impl_const_default {
24 ($($(
25#[doc = $doc:expr])*
26 $(#[cfg($($cfg:tt)+)])?
27$(#[expect($($expected:tt)+)])?
28$(@$pub:ident)? $type:ty => $default:expr;
29 )*) => {$(
30 $(#[cfg($($cfg)+)])?
31$(#[expect($($expected)+)])?
32impl $type {
33if_pub! {
34 $($pub)?
35$(#[doc = $doc])*;
36#[inline]
37pub const fn default() -> Self {
38$default
39}
40 }
41 }
4243 $(#[doc = $doc])*
44 $(#[cfg($($cfg)+)])?
45$(#[expect($($expected)+)])?
46impl Default for $type {
47#[inline]
48fn default() -> Self {
49$default
50}
51 }
52 )*};
53}
5455// Keep this first so that it's shown at the top of documentation.
56impl End {
#[doc =
r" Creates a modifier used to represent the end of input, not allowing any trailing input (i.e."]
#[doc = r" the input must be fully consumed)."]
///
/// This function exists since [`Default::default()`] cannot be used in a `const` context.
/// It may be removed once that becomes possible. As the [`Default`] trait is in the
/// prelude, removing this function in the future will not cause any resolution failures for
/// the overwhelming majority of users; only users who use `#![no_implicit_prelude]` will be
/// affected. As such it will not be considered a breaking change.
#[inline]
pub const fn default() -> Self {
Self { trailing_input: TrailingInput::Prohibit }
}
}
#[doc =
r" Creates a modifier used to represent the end of input, not allowing any trailing input (i.e."]
#[doc = r" the input must be fully consumed)."]
impl Default for End {
#[inline]
fn default() -> Self { Self { trailing_input: TrailingInput::Prohibit } }
}impl_const_default! {
57/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
58@pub Day => Self { padding: Padding::Zero };
59/// Creates a modifier that indicates the value uses the
60 /// [`Numerical`](Self::Numerical) representation.
61#[expect(deprecated)]
62MonthRepr => Self::Numerical;
63 @pub MonthShort => Self { case_sensitive: true };
64 @pub MonthLong => Self { case_sensitive: true };
65 @pub MonthNumerical => Self { padding: Padding::Zero };
66/// Creates an instance of this type that indicates the value uses the
67 /// [`Numerical`](MonthRepr::Numerical) representation, is [padded with zeroes](Padding::Zero),
68 /// and is case-sensitive when parsing.
69#[expect(deprecated)]
70@pub Month => Self {
71 padding: Padding::Zero,
72 repr: MonthRepr::Numerical,
73 case_sensitive: true,
74 };
75/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
76@pub Ordinal => Self { padding: Padding::Zero };
77/// Creates a modifier that indicates the value uses the [`Long`](Self::Long) representation.
78#[expect(deprecated)]
79WeekdayRepr => Self::Long;
80 @pub WeekdayShort => Self { case_sensitive: true };
81 @pub WeekdayLong => Self { case_sensitive: true };
82 @pub WeekdaySunday => Self { one_indexed: true };
83 @pub WeekdayMonday => Self { one_indexed: true };
84/// Creates a modifier that indicates the value uses the [`Long`](WeekdayRepr::Long)
85 /// representation and is case-sensitive when parsing. If the representation is changed to a
86 /// numerical one, the instance defaults to one-based indexing.
87#[expect(deprecated)]
88@pub Weekday => Self {
89 repr: WeekdayRepr::Long,
90 one_indexed: true,
91 case_sensitive: true,
92 };
93/// Creates a modifier that indicates that the value uses the [`Iso`](Self::Iso) representation.
94#[expect(deprecated)]
95WeekNumberRepr => Self::Iso;
96 @pub WeekNumberIso => Self { padding: Padding::Zero };
97 @pub WeekNumberSunday => Self { padding: Padding::Zero };
98 @pub WeekNumberMonday => Self { padding: Padding::Zero };
99/// Creates a modifier that indicates that the value is [padded with zeroes](Padding::Zero)
100 /// and uses the [`Iso`](WeekNumberRepr::Iso) representation.
101#[expect(deprecated)]
102@pub WeekNumber => Self {
103 padding: Padding::Zero,
104 repr: WeekNumberRepr::Iso,
105 };
106/// Creates a modifier that indicates the value uses the [`Full`](Self::Full) representation.
107#[expect(deprecated)]
108YearRepr => Self::Full;
109/// Creates a modifier that indicates the value uses the [`Extended`](Self::Extended) range.
110 ///
111 /// Note that this is the default modifier for version 1 and 2 format descriptions. Version 3
112 /// format descriptions (which cannot be manually constructed) use `Standard` as the default.
113#[expect(deprecated)]
114YearRange => Self::Extended;
115 @pub CalendarYearFullExtendedRange => Self {
116 padding: Padding::Zero,
117 sign_is_mandatory: false,
118 };
119 @pub CalendarYearFullStandardRange => Self {
120 padding: Padding::Zero,
121 sign_is_mandatory: false,
122 };
123 @pub IsoYearFullExtendedRange => Self {
124 padding: Padding::Zero,
125 sign_is_mandatory: false,
126 };
127 @pub IsoYearFullStandardRange => Self {
128 padding: Padding::Zero,
129 sign_is_mandatory: false,
130 };
131 @pub CalendarYearCenturyExtendedRange => Self {
132 padding: Padding::Zero,
133 sign_is_mandatory: false,
134 };
135 @pub CalendarYearCenturyStandardRange => Self {
136 padding: Padding::Zero,
137 sign_is_mandatory: false,
138 };
139 @pub IsoYearCenturyExtendedRange => Self {
140 padding: Padding::Zero,
141 sign_is_mandatory: false,
142 };
143 @pub IsoYearCenturyStandardRange => Self {
144 padding: Padding::Zero,
145 sign_is_mandatory: false,
146 };
147 @pub CalendarYearLastTwo => Self {
148 padding: Padding::Zero,
149 };
150 @pub IsoYearLastTwo => Self {
151 padding: Padding::Zero,
152 };
153/// Creates a modifier that indicates the value uses the [`Full`](YearRepr::Full)
154 /// representation, is [padded with zeroes](Padding::Zero), uses the Gregorian calendar as its
155 /// base, and only includes the year's sign if necessary.
156#[expect(deprecated)]
157@pub Year => Self {
158 padding: Padding::Zero,
159 repr: YearRepr::Full,
160 range: YearRange::Extended,
161 iso_week_based: false,
162 sign_is_mandatory: false,
163 };
164 @pub Hour12 => Self { padding: Padding::Zero };
165 @pub Hour24 => Self { padding: Padding::Zero };
166/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero) and
167 /// has the 24-hour representation.
168#[expect(deprecated)]
169@pub Hour => Self {
170 padding: Padding::Zero,
171 is_12_hour_clock: false,
172 };
173/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
174@pub Minute => Self { padding: Padding::Zero };
175/// Creates a modifier that indicates the value uses the upper-case representation and is
176 /// case-sensitive when parsing.
177@pub Period => Self {
178 is_uppercase: true,
179 case_sensitive: true,
180 };
181/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
182@pub Second => Self { padding: Padding::Zero };
183/// Creates a modifier that indicates the stringified value contains [one or more
184 /// digits](Self::OneOrMore).
185SubsecondDigits => Self::OneOrMore;
186/// Creates a modifier that indicates the stringified value contains [one or more
187 /// digits](SubsecondDigits::OneOrMore).
188@pub Subsecond => Self { digits: SubsecondDigits::OneOrMore };
189/// Creates a modifier that indicates the value only uses a sign for negative values and is
190 /// [padded with zeroes](Padding::Zero).
191@pub OffsetHour => Self {
192 sign_is_mandatory: false,
193 padding: Padding::Zero,
194 };
195/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
196@pub OffsetMinute => Self { padding: Padding::Zero };
197/// Creates a modifier that indicates the value is [padded with zeroes](Padding::Zero).
198@pub OffsetSecond => Self { padding: Padding::Zero };
199/// Creates a modifier that indicates the value is [padded with zeroes](Self::Zero).
200Padding => Self::Zero;
201/// Creates a modifier that indicates the value represents the [number of seconds](Self::Second)
202 /// since the Unix epoch.
203#[expect(deprecated)]
204UnixTimestampPrecision => Self::Second;
205 @pub UnixTimestampSecond => Self { sign_is_mandatory: false };
206 @pub UnixTimestampMillisecond => Self { sign_is_mandatory: false };
207 @pub UnixTimestampMicrosecond => Self { sign_is_mandatory: false };
208 @pub UnixTimestampNanosecond => Self { sign_is_mandatory: false };
209/// Creates a modifier that indicates the value represents the [number of
210 /// seconds](UnixTimestampPrecision::Second) since the Unix epoch. The sign is not mandatory.
211#[expect(deprecated)]
212@pub UnixTimestamp => Self {
213 precision: UnixTimestampPrecision::Second,
214 sign_is_mandatory: false,
215 };
216/// Indicate that any trailing characters after the end of input are prohibited and will cause
217 /// an error when used with `parse`.
218TrailingInput => Self::Prohibit;
219/// Creates a modifier used to represent the end of input, not allowing any trailing input (i.e.
220 /// the input must be fully consumed).
221@pub End => Self { trailing_input: TrailingInput::Prohibit };
222}223224macro_rules! builder_methods {
225 ($(
226 $(#[$fn_attr:meta])*
227fn $method:ident($field:ident : $field_ty:ty);
228 )+) => {$(
229 $(#[$fn_attr])*
230#[allow(clippy::needless_update, reason = "needed for types with multiple fields")]
231 #[inline]
232 #[must_use = "this returns the result of the operation, without modifying the original"]
233pub const fn $method(self, $field: $field_ty) -> Self {
234Self { $field, ..self }
235 }
236 )+ };
237}
238239/// Day of the month.
240#[non_exhaustive]
241#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Day {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Day",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Day {
#[inline]
fn clone(&self) -> Day {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Day { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Day {
#[inline]
fn eq(&self, other: &Day) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Day {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
242pub struct Day {
243/// The padding to obtain the minimum width.
244pub padding: Padding,
245}
246247impl Day {
248#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
249/// Set the padding type.
250fn with_padding(padding: Padding);
251 }252}
253254/// The representation of a month.
255#[non_exhaustive]
256#[deprecated(
257 since = "0.3.48",
258 note = "used only in the deprecated `Month` component"
259)]
260#[derive(#[automatically_derived]
impl ::core::fmt::Debug for MonthRepr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
MonthRepr::Numerical => "Numerical",
MonthRepr::Long => "Long",
MonthRepr::Short => "Short",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for MonthRepr {
#[inline]
fn clone(&self) -> MonthRepr { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MonthRepr { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for MonthRepr {
#[inline]
fn eq(&self, other: &MonthRepr) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for MonthRepr {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
261pub enum MonthRepr {
262/// The number of the month (January is 1, December is 12).
263Numerical,
264/// The long form of the month name (e.g. "January").
265Long,
266/// The short form of the month name (e.g. "Jan").
267Short,
268}
269270/// Month of the year using the short form of the month name (e.g. "Jan").
271#[derive(#[automatically_derived]
impl ::core::fmt::Debug for MonthShort {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "MonthShort",
"case_sensitive", &&self.case_sensitive)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for MonthShort {
#[inline]
fn clone(&self) -> MonthShort {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MonthShort { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for MonthShort {
#[inline]
fn eq(&self, other: &MonthShort) -> bool {
self.case_sensitive == other.case_sensitive
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for MonthShort {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
272pub struct MonthShort {
273/// Is the value case sensitive when parsing?
274pub(crate) case_sensitive: bool,
275}
276277impl MonthShort {
278#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
279/// Set whether the value is case sensitive when parsing.
280fn with_case_sensitive(case_sensitive: bool);
281 }282}
283284/// Month of the year using the long form of the month name (e.g. "January").
285#[derive(#[automatically_derived]
impl ::core::fmt::Debug for MonthLong {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "MonthLong",
"case_sensitive", &&self.case_sensitive)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for MonthLong {
#[inline]
fn clone(&self) -> MonthLong {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MonthLong { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for MonthLong {
#[inline]
fn eq(&self, other: &MonthLong) -> bool {
self.case_sensitive == other.case_sensitive
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for MonthLong {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
286pub struct MonthLong {
287/// Is the value case sensitive when parsing?
288pub(crate) case_sensitive: bool,
289}
290291impl MonthLong {
292#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
293/// Set whether the value is case sensitive when parsing.
294fn with_case_sensitive(case_sensitive: bool);
295 }296}
297298/// Month of the year using a numerical representation (e.g. "1" for January).
299#[derive(#[automatically_derived]
impl ::core::fmt::Debug for MonthNumerical {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"MonthNumerical", "padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for MonthNumerical {
#[inline]
fn clone(&self) -> MonthNumerical {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for MonthNumerical { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for MonthNumerical {
#[inline]
fn eq(&self, other: &MonthNumerical) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for MonthNumerical {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
300pub struct MonthNumerical {
301/// The padding to obtain the minimum width.
302pub(crate) padding: Padding,
303}
304305impl MonthNumerical {
306#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
307/// Set the padding type.
308fn with_padding(padding: Padding);
309 }310}
311312/// Month of the year.
313#[non_exhaustive]
314#[allow(deprecated)]
315#[deprecated(
316 since = "0.3.48",
317 note = "use `MonthShort`, `MonthLong`, or `MonthNumeric` instead"
318)]
319#[derive(#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for Month {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Month",
"padding", &self.padding, "repr", &self.repr, "case_sensitive",
&&self.case_sensitive)
}
}Debug, #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for Month {
#[inline]
fn clone(&self) -> Month {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<MonthRepr>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for Month { }Copy, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::PartialEq for Month {
#[inline]
fn eq(&self, other: &Month) -> bool {
self.case_sensitive == other.case_sensitive &&
self.padding == other.padding && self.repr == other.repr
}
}PartialEq, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::Eq for Month {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<MonthRepr>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
320pub struct Month {
321/// The padding to obtain the minimum width.
322pub padding: Padding,
323/// What form of representation should be used?
324pub repr: MonthRepr,
325/// Is the value case sensitive when parsing?
326pub case_sensitive: bool,
327}
328329#[expect(deprecated)]
330impl Month {
331#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
332/// Set the padding type.
333fn with_padding(padding: Padding);
334/// Set the manner in which the month is represented.
335fn with_repr(repr: MonthRepr);
336/// Set whether the value is case sensitive when parsing.
337fn with_case_sensitive(case_sensitive: bool);
338 }339}
340341/// Ordinal day of the year.
342#[non_exhaustive]
343#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Ordinal {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Ordinal",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Ordinal {
#[inline]
fn clone(&self) -> Ordinal {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Ordinal { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Ordinal {
#[inline]
fn eq(&self, other: &Ordinal) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Ordinal {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
344pub struct Ordinal {
345/// The padding to obtain the minimum width.
346pub padding: Padding,
347}
348349impl Ordinal {
350#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
351/// Set the padding type.
352fn with_padding(padding: Padding);
353 }354}
355356/// The representation used for the day of the week.
357#[non_exhaustive]
358#[deprecated(
359 since = "0.3.48",
360 note = "used only in the deprecated `Weekday` component"
361)]
362#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekdayRepr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
WeekdayRepr::Short => "Short",
WeekdayRepr::Long => "Long",
WeekdayRepr::Sunday => "Sunday",
WeekdayRepr::Monday => "Monday",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekdayRepr {
#[inline]
fn clone(&self) -> WeekdayRepr { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekdayRepr { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekdayRepr {
#[inline]
fn eq(&self, other: &WeekdayRepr) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekdayRepr {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
363pub enum WeekdayRepr {
364/// The short form of the weekday (e.g. "Mon").
365Short,
366/// The long form of the weekday (e.g. "Monday").
367Long,
368/// A numerical representation using Sunday as the first day of the week.
369 ///
370 /// Sunday is either 0 or 1, depending on the other modifier's value.
371Sunday,
372/// A numerical representation using Monday as the first day of the week.
373 ///
374 /// Monday is either 0 or 1, depending on the other modifier's value.
375Monday,
376}
377378/// Day of the week using the short form of the weekday (e.g. "Mon").
379#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekdayShort {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "WeekdayShort",
"case_sensitive", &&self.case_sensitive)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekdayShort {
#[inline]
fn clone(&self) -> WeekdayShort {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekdayShort { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekdayShort {
#[inline]
fn eq(&self, other: &WeekdayShort) -> bool {
self.case_sensitive == other.case_sensitive
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekdayShort {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
380pub struct WeekdayShort {
381/// Is the value case sensitive when parsing?
382pub(crate) case_sensitive: bool,
383}
384385impl WeekdayShort {
386#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
387/// Set whether the value is case sensitive when parsing.
388fn with_case_sensitive(case_sensitive: bool);
389 }390}
391392/// Day of the week using the long form of the weekday (e.g. "Monday").
393#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekdayLong {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "WeekdayLong",
"case_sensitive", &&self.case_sensitive)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekdayLong {
#[inline]
fn clone(&self) -> WeekdayLong {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekdayLong { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekdayLong {
#[inline]
fn eq(&self, other: &WeekdayLong) -> bool {
self.case_sensitive == other.case_sensitive
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekdayLong {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
394pub struct WeekdayLong {
395/// Is the value case sensitive when parsing?
396pub(crate) case_sensitive: bool,
397}
398399impl WeekdayLong {
400#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
401/// Set whether the value is case sensitive when parsing.
402fn with_case_sensitive(case_sensitive: bool);
403 }404}
405406/// Day of the week using a numerical representation with Sunday as the first day of the week.
407#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekdaySunday {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "WeekdaySunday",
"one_indexed", &&self.one_indexed)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekdaySunday {
#[inline]
fn clone(&self) -> WeekdaySunday {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekdaySunday { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekdaySunday {
#[inline]
fn eq(&self, other: &WeekdaySunday) -> bool {
self.one_indexed == other.one_indexed
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekdaySunday {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
408pub struct WeekdaySunday {
409/// Is the value zero or one-indexed?
410pub(crate) one_indexed: bool,
411}
412413impl WeekdaySunday {
414#[doc = r" Set whether the value is one-indexed."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_one_indexed(self, one_indexed: bool) -> Self {
Self { one_indexed, ..self }
}builder_methods! {
415/// Set whether the value is one-indexed.
416fn with_one_indexed(one_indexed: bool);
417 }418}
419420/// Day of the week using a numerical representation with Monday as the first day of the week.
421#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekdayMonday {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "WeekdayMonday",
"one_indexed", &&self.one_indexed)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekdayMonday {
#[inline]
fn clone(&self) -> WeekdayMonday {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekdayMonday { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekdayMonday {
#[inline]
fn eq(&self, other: &WeekdayMonday) -> bool {
self.one_indexed == other.one_indexed
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekdayMonday {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
422pub struct WeekdayMonday {
423/// Is the value zero or one-indexed?
424pub(crate) one_indexed: bool,
425}
426427impl WeekdayMonday {
428#[doc = r" Set whether the value is one-indexed."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_one_indexed(self, one_indexed: bool) -> Self {
Self { one_indexed, ..self }
}builder_methods! {
429/// Set whether the value is one-indexed.
430fn with_one_indexed(one_indexed: bool);
431 }432}
433434/// Day of the week.
435#[non_exhaustive]
436#[allow(deprecated)]
437#[deprecated(
438 since = "0.3.48",
439 note = "use `WeekdayShort`, `WeekdayLong`, `WeekdaySunday`, or `WeekdayMonday` instead"
440)]
441#[derive(#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for Weekday {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f, "Weekday",
"repr", &self.repr, "one_indexed", &self.one_indexed,
"case_sensitive", &&self.case_sensitive)
}
}Debug, #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for Weekday {
#[inline]
fn clone(&self) -> Weekday {
let _: ::core::clone::AssertParamIsClone<WeekdayRepr>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for Weekday { }Copy, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::PartialEq for Weekday {
#[inline]
fn eq(&self, other: &Weekday) -> bool {
self.one_indexed == other.one_indexed &&
self.case_sensitive == other.case_sensitive &&
self.repr == other.repr
}
}PartialEq, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::Eq for Weekday {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<WeekdayRepr>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
442pub struct Weekday {
443/// What form of representation should be used?
444pub repr: WeekdayRepr,
445/// When using a numerical representation, should it be zero or one-indexed?
446pub one_indexed: bool,
447/// Is the value case sensitive when parsing?
448pub case_sensitive: bool,
449}
450451#[expect(deprecated)]
452impl Weekday {
453#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
454/// Set the manner in which the weekday is represented.
455fn with_repr(repr: WeekdayRepr);
456/// Set whether the value is one-indexed when using a numerical representation.
457fn with_one_indexed(one_indexed: bool);
458/// Set whether the value is case sensitive when parsing.
459fn with_case_sensitive(case_sensitive: bool);
460 }461}
462463/// The representation used for the week number.
464#[non_exhaustive]
465#[deprecated(
466 since = "0.3.48",
467 note = "used only in the deprecated `WeekNumber` component"
468)]
469#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekNumberRepr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
WeekNumberRepr::Iso => "Iso",
WeekNumberRepr::Sunday => "Sunday",
WeekNumberRepr::Monday => "Monday",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekNumberRepr {
#[inline]
fn clone(&self) -> WeekNumberRepr { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekNumberRepr { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekNumberRepr {
#[inline]
fn eq(&self, other: &WeekNumberRepr) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekNumberRepr {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
470pub enum WeekNumberRepr {
471/// Week 1 is the week that contains January 4.
472Iso,
473/// Week 1 begins on the first Sunday of the calendar year.
474Sunday,
475/// Week 1 begins on the first Monday of the calendar year.
476Monday,
477}
478479/// Week within the year using the ISO week calendar.
480///
481/// Week 1 is the week that contains January 4. All weeks begin on a Monday.
482#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekNumberIso {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "WeekNumberIso",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekNumberIso {
#[inline]
fn clone(&self) -> WeekNumberIso {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekNumberIso { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekNumberIso {
#[inline]
fn eq(&self, other: &WeekNumberIso) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekNumberIso {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
483pub struct WeekNumberIso {
484/// The padding to obtain the minimum width.
485pub padding: Padding,
486}
487488impl WeekNumberIso {
489#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
490/// Set the padding type.
491fn with_padding(padding: Padding);
492 }493}
494495/// Week within the calendar year.
496///
497/// Week 1 begins on the first Sunday of the calendar year.
498#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekNumberSunday {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"WeekNumberSunday", "padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekNumberSunday {
#[inline]
fn clone(&self) -> WeekNumberSunday {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekNumberSunday { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekNumberSunday {
#[inline]
fn eq(&self, other: &WeekNumberSunday) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekNumberSunday {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
499pub struct WeekNumberSunday {
500/// The padding to obtain the minimum width.
501pub padding: Padding,
502}
503504impl WeekNumberSunday {
505#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
506/// Set the padding type.
507fn with_padding(padding: Padding);
508 }509}
510511/// Week within the calendar year.
512///
513/// Week 1 begins on the first Monday of the calendar year.
514#[derive(#[automatically_derived]
impl ::core::fmt::Debug for WeekNumberMonday {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"WeekNumberMonday", "padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for WeekNumberMonday {
#[inline]
fn clone(&self) -> WeekNumberMonday {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for WeekNumberMonday { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for WeekNumberMonday {
#[inline]
fn eq(&self, other: &WeekNumberMonday) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WeekNumberMonday {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
515pub struct WeekNumberMonday {
516/// The padding to obtain the minimum width.
517pub padding: Padding,
518}
519520impl WeekNumberMonday {
521#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
522/// Set the padding type.
523fn with_padding(padding: Padding);
524 }525}
526527/// Week within the year.
528#[non_exhaustive]
529#[allow(deprecated)]
530#[deprecated(
531 since = "0.3.48",
532 note = "use `WeekNumberIso`, `WeekNumberSunday`, or `WeekNumberMonday` instead"
533)]
534#[derive(#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for WeekNumber {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "WeekNumber",
"padding", &self.padding, "repr", &&self.repr)
}
}Debug, #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for WeekNumber {
#[inline]
fn clone(&self) -> WeekNumber {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<WeekNumberRepr>;
*self
}
}Clone, #[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for WeekNumber { }Copy, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::PartialEq for WeekNumber {
#[inline]
fn eq(&self, other: &WeekNumber) -> bool {
self.padding == other.padding && self.repr == other.repr
}
}PartialEq, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::Eq for WeekNumber {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<WeekNumberRepr>;
}
}Eq)]
535pub struct WeekNumber {
536/// The padding to obtain the minimum width.
537pub padding: Padding,
538/// What kind of representation should be used?
539pub repr: WeekNumberRepr,
540}
541542#[expect(deprecated)]
543impl WeekNumber {
544#[doc = r" Set the manner in which the week number is represented."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_repr(self, repr: WeekNumberRepr) -> Self {
Self { repr, ..self }
}builder_methods! {
545/// Set the padding type.
546fn with_padding(padding: Padding);
547/// Set the manner in which the week number is represented.
548fn with_repr(repr: WeekNumberRepr);
549 }550}
551552/// The representation used for a year value.
553#[non_exhaustive]
554#[deprecated(
555 since = "0.3.48",
556 note = "used only in the deprecated `Year` component"
557)]
558#[derive(#[automatically_derived]
impl ::core::fmt::Debug for YearRepr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
YearRepr::Full => "Full",
YearRepr::Century => "Century",
YearRepr::LastTwo => "LastTwo",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for YearRepr {
#[inline]
fn clone(&self) -> YearRepr { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for YearRepr { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for YearRepr {
#[inline]
fn eq(&self, other: &YearRepr) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for YearRepr {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
559pub enum YearRepr {
560/// The full value of the year.
561Full,
562/// All digits except the last two. Includes the sign, if any.
563Century,
564/// Only the last two digits of the year.
565LastTwo,
566}
567568/// The range of years that are supported.
569///
570/// This modifier has no effect when the year repr is [`LastTwo`](YearRepr::LastTwo).
571#[non_exhaustive]
572#[deprecated(
573 since = "0.3.48",
574 note = "used only in the deprecated `Year` component"
575)]
576#[derive(#[automatically_derived]
impl ::core::fmt::Debug for YearRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
YearRange::Standard => "Standard",
YearRange::Extended => "Extended",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for YearRange {
#[inline]
fn clone(&self) -> YearRange { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for YearRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for YearRange {
#[inline]
fn eq(&self, other: &YearRange) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for YearRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
577pub enum YearRange {
578/// Years between -9999 and 9999 are supported.
579Standard,
580/// Years between -999_999 and 999_999 are supported, with the sign being required if the year
581 /// contains more than four digits.
582 ///
583 /// If the `large-dates` feature is not enabled, this variant is equivalent to `Standard`.
584Extended,
585}
586587/// Year of the date. All digits are included, the calendar year is used, and the range of years
588/// supported is ±999,999.
589#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CalendarYearFullExtendedRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CalendarYearFullExtendedRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CalendarYearFullExtendedRange {
#[inline]
fn clone(&self) -> CalendarYearFullExtendedRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for CalendarYearFullExtendedRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for CalendarYearFullExtendedRange {
#[inline]
fn eq(&self, other: &CalendarYearFullExtendedRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CalendarYearFullExtendedRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
590pub struct CalendarYearFullExtendedRange {
591/// The padding to obtain the minimum width.
592pub(crate) padding: Padding,
593/// Whether the `+` sign is present when a non-negative year contains fewer digits than
594 /// necessary.
595pub(crate) sign_is_mandatory: bool,
596}
597598impl CalendarYearFullExtendedRange {
599#[doc =
r" Set whether the `+` sign is mandatory for non-negative years with more than four digits."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
600/// Set the padding type.
601fn with_padding(padding: Padding);
602/// Set whether the `+` sign is mandatory for non-negative years with more than four digits.
603fn with_sign_is_mandatory(sign_is_mandatory: bool);
604 }605}
606607/// Year of the date. All digits are included, the calendar year is used, and the range of years
608/// supported is ±9,999.
609#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CalendarYearFullStandardRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CalendarYearFullStandardRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CalendarYearFullStandardRange {
#[inline]
fn clone(&self) -> CalendarYearFullStandardRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for CalendarYearFullStandardRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for CalendarYearFullStandardRange {
#[inline]
fn eq(&self, other: &CalendarYearFullStandardRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CalendarYearFullStandardRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
610pub struct CalendarYearFullStandardRange {
611/// The padding to obtain the minimum width.
612pub(crate) padding: Padding,
613/// Whether the `+` sign is present when a non-negative year contains fewer digits than
614 /// necessary.
615pub(crate) sign_is_mandatory: bool,
616}
617618impl CalendarYearFullStandardRange {
619#[doc = r" Set whether the `+` sign is present on non-negative years."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
620/// Set the padding type.
621fn with_padding(padding: Padding);
622/// Set whether the `+` sign is present on non-negative years.
623fn with_sign_is_mandatory(sign_is_mandatory: bool);
624 }625}
626627/// Year of the date. All digits are included, the ISO week-numbering year is used, and the range of
628/// years supported is ±999,999.
629#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsoYearFullExtendedRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"IsoYearFullExtendedRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsoYearFullExtendedRange {
#[inline]
fn clone(&self) -> IsoYearFullExtendedRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsoYearFullExtendedRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for IsoYearFullExtendedRange {
#[inline]
fn eq(&self, other: &IsoYearFullExtendedRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsoYearFullExtendedRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
630pub struct IsoYearFullExtendedRange {
631/// The padding to obtain the minimum width.
632pub(crate) padding: Padding,
633/// Whether the `+` sign is present when a non-negative year contains fewer digits than
634 /// necessary.
635pub(crate) sign_is_mandatory: bool,
636}
637638impl IsoYearFullExtendedRange {
639#[doc =
r" Set whether the `+` sign is mandatory for non-negative years with more than four digits."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
640/// Set the padding type.
641fn with_padding(padding: Padding);
642/// Set whether the `+` sign is mandatory for non-negative years with more than four digits.
643fn with_sign_is_mandatory(sign_is_mandatory: bool);
644 }645}
646647/// Year of the date. All digits are included, the ISO week-numbering year is used, and the range of
648/// supported is ±9,999.
649#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsoYearFullStandardRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"IsoYearFullStandardRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsoYearFullStandardRange {
#[inline]
fn clone(&self) -> IsoYearFullStandardRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsoYearFullStandardRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for IsoYearFullStandardRange {
#[inline]
fn eq(&self, other: &IsoYearFullStandardRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsoYearFullStandardRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
650pub struct IsoYearFullStandardRange {
651/// The padding to obtain the minimum width.
652pub(crate) padding: Padding,
653/// Whether the `+` sign is present when a non-negative year contains fewer digits than
654 /// necessary.
655pub(crate) sign_is_mandatory: bool,
656}
657658impl IsoYearFullStandardRange {
659#[doc = r" Set whether the `+` sign is present on non-negative years."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
660/// Set the padding type.
661fn with_padding(padding: Padding);
662/// Set whether the `+` sign is present on non-negative years.
663fn with_sign_is_mandatory(sign_is_mandatory: bool);
664 }665}
666667/// Year of the date. Only the century is included (i.e. all digits except the last two), the
668/// calendar year is used, and the range of years supported is ±999,999.
669#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CalendarYearCenturyExtendedRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CalendarYearCenturyExtendedRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CalendarYearCenturyExtendedRange {
#[inline]
fn clone(&self) -> CalendarYearCenturyExtendedRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for CalendarYearCenturyExtendedRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for CalendarYearCenturyExtendedRange {
#[inline]
fn eq(&self, other: &CalendarYearCenturyExtendedRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CalendarYearCenturyExtendedRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
670pub struct CalendarYearCenturyExtendedRange {
671/// The padding to obtain the minimum width.
672pub(crate) padding: Padding,
673/// Whether the `+` sign is present when a non-negative year contains fewer digits than
674 /// necessary.
675pub(crate) sign_is_mandatory: bool,
676}
677678impl CalendarYearCenturyExtendedRange {
679#[doc =
r" Set whether the `+` sign is mandatory for non-negative years with more than four digits."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
680/// Set the padding type.
681fn with_padding(padding: Padding);
682/// Set whether the `+` sign is mandatory for non-negative years with more than four digits.
683fn with_sign_is_mandatory(sign_is_mandatory: bool);
684 }685}
686687/// Year of the date. Only the century is included (i.e. all digits except the last two), the
688/// calendar year is used, and the range of years supported is ±9,999.
689#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CalendarYearCenturyStandardRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CalendarYearCenturyStandardRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CalendarYearCenturyStandardRange {
#[inline]
fn clone(&self) -> CalendarYearCenturyStandardRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for CalendarYearCenturyStandardRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for CalendarYearCenturyStandardRange {
#[inline]
fn eq(&self, other: &CalendarYearCenturyStandardRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CalendarYearCenturyStandardRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
690pub struct CalendarYearCenturyStandardRange {
691/// The padding to obtain the minimum width.
692pub(crate) padding: Padding,
693/// Whether the `+` sign is present when a non-negative year contains fewer digits than
694 /// necessary.
695pub(crate) sign_is_mandatory: bool,
696}
697698impl CalendarYearCenturyStandardRange {
699#[doc = r" Set whether the `+` sign is present on non-negative years."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
700/// Set the padding type.
701fn with_padding(padding: Padding);
702/// Set whether the `+` sign is present on non-negative years.
703fn with_sign_is_mandatory(sign_is_mandatory: bool);
704 }705}
706707/// Year of the date. Only the century is included (i.e. all digits except the last two), the ISO
708/// week-numbering year is used, and the range of years supported is ±999,999.
709#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsoYearCenturyExtendedRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"IsoYearCenturyExtendedRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsoYearCenturyExtendedRange {
#[inline]
fn clone(&self) -> IsoYearCenturyExtendedRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsoYearCenturyExtendedRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for IsoYearCenturyExtendedRange {
#[inline]
fn eq(&self, other: &IsoYearCenturyExtendedRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsoYearCenturyExtendedRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
710pub struct IsoYearCenturyExtendedRange {
711/// The padding to obtain the minimum width.
712pub(crate) padding: Padding,
713/// Whether the `+` sign is present when a non-negative year contains fewer digits than
714 /// necessary.
715pub(crate) sign_is_mandatory: bool,
716}
717718impl IsoYearCenturyExtendedRange {
719#[doc =
r" Set whether the `+` sign is mandatory for non-negative years with more than four digits."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
720/// Set the padding type.
721fn with_padding(padding: Padding);
722/// Set whether the `+` sign is mandatory for non-negative years with more than four digits.
723fn with_sign_is_mandatory(sign_is_mandatory: bool);
724 }725}
726727/// Year of the date. Only the century is included (i.e. all digits except the last two), the ISO
728/// week-numbering year is used, and the range of years supported is ±9,999.
729#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsoYearCenturyStandardRange {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"IsoYearCenturyStandardRange", "padding", &self.padding,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsoYearCenturyStandardRange {
#[inline]
fn clone(&self) -> IsoYearCenturyStandardRange {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsoYearCenturyStandardRange { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for IsoYearCenturyStandardRange {
#[inline]
fn eq(&self, other: &IsoYearCenturyStandardRange) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsoYearCenturyStandardRange {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
730pub struct IsoYearCenturyStandardRange {
731/// The padding to obtain the minimum width.
732pub(crate) padding: Padding,
733/// Whether the `+` sign is present when a non-negative year contains fewer digits than
734 /// necessary.
735pub(crate) sign_is_mandatory: bool,
736}
737738impl IsoYearCenturyStandardRange {
739#[doc = r" Set whether the `+` sign is present on non-negative years."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
740/// Set the padding type.
741fn with_padding(padding: Padding);
742/// Set whether the `+` sign is present on non-negative years.
743fn with_sign_is_mandatory(sign_is_mandatory: bool);
744 }745}
746747/// Year of the date. Only the last two digits are included, and the calendar year is used.
748#[non_exhaustive]
749#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CalendarYearLastTwo {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"CalendarYearLastTwo", "padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CalendarYearLastTwo {
#[inline]
fn clone(&self) -> CalendarYearLastTwo {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for CalendarYearLastTwo { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for CalendarYearLastTwo {
#[inline]
fn eq(&self, other: &CalendarYearLastTwo) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CalendarYearLastTwo {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
750pub struct CalendarYearLastTwo {
751/// The padding to obtain the minimum width.
752pub(crate) padding: Padding,
753}
754755impl CalendarYearLastTwo {
756#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
757/// Set the padding type.
758fn with_padding(padding: Padding);
759 }760}
761762/// Year of the date. Only the last two digits are included, and the ISO week-numbering year is
763/// used.
764#[non_exhaustive]
765#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsoYearLastTwo {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"IsoYearLastTwo", "padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsoYearLastTwo {
#[inline]
fn clone(&self) -> IsoYearLastTwo {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsoYearLastTwo { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for IsoYearLastTwo {
#[inline]
fn eq(&self, other: &IsoYearLastTwo) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsoYearLastTwo {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
766pub struct IsoYearLastTwo {
767/// The padding to obtain the minimum width.
768pub(crate) padding: Padding,
769}
770771impl IsoYearLastTwo {
772#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
773/// Set the padding type.
774fn with_padding(padding: Padding);
775 }776}
777778/// Year of the date.
779#[non_exhaustive]
780#[allow(deprecated)]
781#[deprecated(
782 since = "0.3.48",
783 note = "use one of the various `Year*` components instead"
784)]
785#[derive(#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for Year {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field5_finish(f, "Year",
"padding", &self.padding, "repr", &self.repr, "range",
&self.range, "iso_week_based", &self.iso_week_based,
"sign_is_mandatory", &&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for Year {
#[inline]
fn clone(&self) -> Year {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<YearRepr>;
let _: ::core::clone::AssertParamIsClone<YearRange>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for Year { }Copy, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::PartialEq for Year {
#[inline]
fn eq(&self, other: &Year) -> bool {
self.iso_week_based == other.iso_week_based &&
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding && self.repr == other.repr &&
self.range == other.range
}
}PartialEq, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::Eq for Year {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<YearRepr>;
let _: ::core::cmp::AssertParamIsEq<YearRange>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
786pub struct Year {
787/// The padding to obtain the minimum width.
788pub padding: Padding,
789/// What kind of representation should be used?
790pub repr: YearRepr,
791/// What range of years is supported?
792pub range: YearRange,
793/// Whether the value is based on the ISO week number or the Gregorian calendar.
794pub iso_week_based: bool,
795/// Whether the `+` sign is present when a non-negative year contains fewer digits than
796 /// necessary.
797pub sign_is_mandatory: bool,
798}
799800#[expect(deprecated)]
801impl Year {
802#[doc =
r" Set whether the `+` sign is mandatory for positive years with fewer than five digits."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
803/// Set the padding type.
804fn with_padding(padding: Padding);
805/// Set the manner in which the year is represented.
806fn with_repr(repr: YearRepr);
807/// Set the range of years that are supported.
808fn with_range(range: YearRange);
809/// Set whether the year is based on the ISO week number.
810fn with_iso_week_based(iso_week_based: bool);
811/// Set whether the `+` sign is mandatory for positive years with fewer than five digits.
812fn with_sign_is_mandatory(sign_is_mandatory: bool);
813 }814}
815816/// Hour of the day using a 12-hour clock.
817#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Hour12 {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Hour12",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Hour12 {
#[inline]
fn clone(&self) -> Hour12 {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Hour12 { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Hour12 {
#[inline]
fn eq(&self, other: &Hour12) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Hour12 {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
818pub struct Hour12 {
819/// The padding to obtain the minimum width.
820pub(crate) padding: Padding,
821}
822823impl Hour12 {
824#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
825/// Set the padding type.
826fn with_padding(padding: Padding);
827 }828}
829830/// Hour of the day using a 24-hour clock.
831#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Hour24 {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Hour24",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Hour24 {
#[inline]
fn clone(&self) -> Hour24 {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Hour24 { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Hour24 {
#[inline]
fn eq(&self, other: &Hour24) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Hour24 {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
832pub struct Hour24 {
833/// The padding to obtain the minimum width.
834pub(crate) padding: Padding,
835}
836837impl Hour24 {
838#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
839/// Set the padding type.
840fn with_padding(padding: Padding);
841 }842}
843844/// Hour of the day.
845#[non_exhaustive]
846#[deprecated(since = "0.3.48", note = "use `Hour12` or `Hour24` instead")]
847#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Hour {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Hour",
"padding", &self.padding, "is_12_hour_clock",
&&self.is_12_hour_clock)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Hour {
#[inline]
fn clone(&self) -> Hour {
let _: ::core::clone::AssertParamIsClone<Padding>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Hour { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Hour {
#[inline]
fn eq(&self, other: &Hour) -> bool {
self.is_12_hour_clock == other.is_12_hour_clock &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Hour {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
848pub struct Hour {
849/// The padding to obtain the minimum width.
850pub padding: Padding,
851/// Is the hour displayed using a 12 or 24-hour clock?
852pub is_12_hour_clock: bool,
853}
854855#[expect(deprecated)]
856impl Hour {
857#[doc = r" Set whether the hour uses a 12-hour clock."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_is_12_hour_clock(self, is_12_hour_clock: bool) -> Self {
Self { is_12_hour_clock, ..self }
}builder_methods! {
858/// Set the padding type.
859fn with_padding(padding: Padding);
860/// Set whether the hour uses a 12-hour clock.
861fn with_is_12_hour_clock(is_12_hour_clock: bool);
862 }863}
864865/// Minute within the hour.
866#[non_exhaustive]
867#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Minute {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Minute",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Minute {
#[inline]
fn clone(&self) -> Minute {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Minute { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Minute {
#[inline]
fn eq(&self, other: &Minute) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Minute {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
868pub struct Minute {
869/// The padding to obtain the minimum width.
870pub padding: Padding,
871}
872873impl Minute {
874#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
875/// Set the padding type.
876fn with_padding(padding: Padding);
877 }878}
879880/// AM/PM part of the time.
881#[non_exhaustive]
882#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Period {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Period",
"is_uppercase", &self.is_uppercase, "case_sensitive",
&&self.case_sensitive)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Period {
#[inline]
fn clone(&self) -> Period {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Period { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Period {
#[inline]
fn eq(&self, other: &Period) -> bool {
self.is_uppercase == other.is_uppercase &&
self.case_sensitive == other.case_sensitive
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Period {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
883pub struct Period {
884/// Is the period uppercase or lowercase?
885pub is_uppercase: bool,
886/// Is the value case sensitive when parsing?
887 ///
888 /// Note that when `false`, the `is_uppercase` field has no effect on parsing behavior.
889pub case_sensitive: bool,
890}
891892impl Period {
893#[doc = r" Set whether the value is case sensitive when parsing."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_case_sensitive(self, case_sensitive: bool) -> Self {
Self { case_sensitive, ..self }
}builder_methods! {
894/// Set whether the period is uppercase.
895fn with_is_uppercase(is_uppercase: bool);
896/// Set whether the value is case sensitive when parsing.
897fn with_case_sensitive(case_sensitive: bool);
898 }899}
900901/// Second within the minute.
902#[non_exhaustive]
903#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Second {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Second",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Second {
#[inline]
fn clone(&self) -> Second {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Second { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Second {
#[inline]
fn eq(&self, other: &Second) -> bool { self.padding == other.padding }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Second {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
904pub struct Second {
905/// The padding to obtain the minimum width.
906pub padding: Padding,
907}
908909impl Second {
910#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
911/// Set the padding type.
912fn with_padding(padding: Padding);
913 }914}
915916/// The number of digits present in a subsecond representation.
917#[non_exhaustive]
918#[derive(#[automatically_derived]
impl ::core::fmt::Debug for SubsecondDigits {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
SubsecondDigits::One => "One",
SubsecondDigits::Two => "Two",
SubsecondDigits::Three => "Three",
SubsecondDigits::Four => "Four",
SubsecondDigits::Five => "Five",
SubsecondDigits::Six => "Six",
SubsecondDigits::Seven => "Seven",
SubsecondDigits::Eight => "Eight",
SubsecondDigits::Nine => "Nine",
SubsecondDigits::OneOrMore => "OneOrMore",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for SubsecondDigits {
#[inline]
fn clone(&self) -> SubsecondDigits { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for SubsecondDigits { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for SubsecondDigits {
#[inline]
fn eq(&self, other: &SubsecondDigits) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for SubsecondDigits {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
919pub enum SubsecondDigits {
920/// Exactly one digit.
921One,
922/// Exactly two digits.
923Two,
924/// Exactly three digits.
925Three,
926/// Exactly four digits.
927Four,
928/// Exactly five digits.
929Five,
930/// Exactly six digits.
931Six,
932/// Exactly seven digits.
933Seven,
934/// Exactly eight digits.
935Eight,
936/// Exactly nine digits.
937Nine,
938/// Any number of digits (up to nine) that is at least one. When formatting, the minimum digits
939 /// necessary will be used.
940OneOrMore,
941}
942943/// Subsecond within the second.
944#[non_exhaustive]
945#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Subsecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Subsecond",
"digits", &&self.digits)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Subsecond {
#[inline]
fn clone(&self) -> Subsecond {
let _: ::core::clone::AssertParamIsClone<SubsecondDigits>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Subsecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Subsecond {
#[inline]
fn eq(&self, other: &Subsecond) -> bool { self.digits == other.digits }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Subsecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<SubsecondDigits>;
}
}Eq)]
946pub struct Subsecond {
947/// How many digits are present in the component?
948pub digits: SubsecondDigits,
949}
950951impl Subsecond {
952#[doc = r" Set the number of digits present in the subsecond representation."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_digits(self, digits: SubsecondDigits) -> Self {
Self { digits, ..self }
}builder_methods! {
953/// Set the number of digits present in the subsecond representation.
954fn with_digits(digits: SubsecondDigits);
955 }956}
957958/// Hour of the UTC offset.
959#[non_exhaustive]
960#[derive(#[automatically_derived]
impl ::core::fmt::Debug for OffsetHour {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "OffsetHour",
"sign_is_mandatory", &self.sign_is_mandatory, "padding",
&&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for OffsetHour {
#[inline]
fn clone(&self) -> OffsetHour {
let _: ::core::clone::AssertParamIsClone<bool>;
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for OffsetHour { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for OffsetHour {
#[inline]
fn eq(&self, other: &OffsetHour) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for OffsetHour {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
961pub struct OffsetHour {
962/// Whether the `+` sign is present on positive values.
963pub sign_is_mandatory: bool,
964/// The padding to obtain the minimum width.
965pub padding: Padding,
966}
967968impl OffsetHour {
969#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
970/// Set whether the `+` sign is mandatory for positive values.
971fn with_sign_is_mandatory(sign_is_mandatory: bool);
972/// Set the padding type.
973fn with_padding(padding: Padding);
974 }975}
976977/// Minute within the hour of the UTC offset.
978#[non_exhaustive]
979#[derive(#[automatically_derived]
impl ::core::fmt::Debug for OffsetMinute {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "OffsetMinute",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for OffsetMinute {
#[inline]
fn clone(&self) -> OffsetMinute {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for OffsetMinute { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for OffsetMinute {
#[inline]
fn eq(&self, other: &OffsetMinute) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for OffsetMinute {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
980pub struct OffsetMinute {
981/// The padding to obtain the minimum width.
982pub padding: Padding,
983}
984985impl OffsetMinute {
986#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
987/// Set the padding type.
988fn with_padding(padding: Padding);
989 }990}
991992/// Second within the minute of the UTC offset.
993#[non_exhaustive]
994#[derive(#[automatically_derived]
impl ::core::fmt::Debug for OffsetSecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "OffsetSecond",
"padding", &&self.padding)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for OffsetSecond {
#[inline]
fn clone(&self) -> OffsetSecond {
let _: ::core::clone::AssertParamIsClone<Padding>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for OffsetSecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for OffsetSecond {
#[inline]
fn eq(&self, other: &OffsetSecond) -> bool {
self.padding == other.padding
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for OffsetSecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Padding>;
}
}Eq)]
995pub struct OffsetSecond {
996/// The padding to obtain the minimum width.
997pub padding: Padding,
998}
9991000impl OffsetSecond {
1001#[doc = r" Set the padding type."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_padding(self, padding: Padding) -> Self {
Self { padding, ..self }
}builder_methods! {
1002/// Set the padding type.
1003fn with_padding(padding: Padding);
1004 }1005}
10061007/// Type of padding to ensure a minimum width.
1008#[non_exhaustive]
1009#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Padding {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
Padding::Space => "Space",
Padding::Zero => "Zero",
Padding::None => "None",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Padding {
#[inline]
fn clone(&self) -> Padding { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Padding { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Padding {
#[inline]
fn eq(&self, other: &Padding) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Padding {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
1010pub enum Padding {
1011/// A space character (` `) should be used as padding.
1012Space,
1013/// A zero character (`0`) should be used as padding.
1014Zero,
1015/// There is no padding. This can result in a width below the otherwise minimum number of
1016 /// characters.
1017None,
1018}
10191020/// Ignore some number of bytes.
1021///
1022/// This has no effect when formatting.
1023#[non_exhaustive]
1024#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Ignore {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Ignore",
"count", &&self.count)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Ignore {
#[inline]
fn clone(&self) -> Ignore {
let _: ::core::clone::AssertParamIsClone<NonZero<u16>>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Ignore { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Ignore {
#[inline]
fn eq(&self, other: &Ignore) -> bool { self.count == other.count }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Ignore {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<NonZero<u16>>;
}
}Eq)]
1025pub struct Ignore {
1026/// The number of bytes to ignore.
1027pub count: NonZero<u16>,
1028}
10291030// Needed as `Default` is deliberately not implemented for `Ignore`. The number of bytes to ignore
1031// must be explicitly provided.
1032impl Ignore {
1033/// Create an instance of `Ignore` with the provided number of bytes to ignore.
1034#[inline]
1035pub const fn count(count: NonZero<u16>) -> Self {
1036Self { count }
1037 }
10381039#[doc = r" Set the number of bytes to ignore."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_count(self, count: NonZero<u16>) -> Self {
Self { count, ..self }
}builder_methods! {
1040/// Set the number of bytes to ignore.
1041fn with_count(count: NonZero<u16>);
1042 }1043}
10441045/// The precision of a Unix timestamp.
1046#[non_exhaustive]
1047#[deprecated(
1048 since = "0.3.48",
1049 note = "only used in the deprecated `UnixTimestamp` component"
1050)]
1051#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UnixTimestampPrecision {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
UnixTimestampPrecision::Second => "Second",
UnixTimestampPrecision::Millisecond => "Millisecond",
UnixTimestampPrecision::Microsecond => "Microsecond",
UnixTimestampPrecision::Nanosecond => "Nanosecond",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for UnixTimestampPrecision {
#[inline]
fn clone(&self) -> UnixTimestampPrecision { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for UnixTimestampPrecision { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for UnixTimestampPrecision {
#[inline]
fn eq(&self, other: &UnixTimestampPrecision) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for UnixTimestampPrecision {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
1052pub enum UnixTimestampPrecision {
1053/// Seconds since the Unix epoch.
1054Second,
1055/// Milliseconds since the Unix epoch.
1056Millisecond,
1057/// Microseconds since the Unix epoch.
1058Microsecond,
1059/// Nanoseconds since the Unix epoch.
1060Nanosecond,
1061}
10621063/// A Unix timestamp in seconds.
1064#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UnixTimestampSecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnixTimestampSecond", "sign_is_mandatory",
&&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for UnixTimestampSecond {
#[inline]
fn clone(&self) -> UnixTimestampSecond {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for UnixTimestampSecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for UnixTimestampSecond {
#[inline]
fn eq(&self, other: &UnixTimestampSecond) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for UnixTimestampSecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
1065pub struct UnixTimestampSecond {
1066/// Whether the `+` sign must be present for a non-negative timestamp.
1067pub(crate) sign_is_mandatory: bool,
1068}
10691070impl UnixTimestampSecond {
1071#[doc =
r" Set whether the `+` sign is mandatory for non-negative timestamps."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
1072/// Set whether the `+` sign is mandatory for non-negative timestamps.
1073fn with_sign_is_mandatory(sign_is_mandatory: bool);
1074 }1075}
10761077/// A Unix timestamp in milliseconds.
1078#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UnixTimestampMillisecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnixTimestampMillisecond", "sign_is_mandatory",
&&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for UnixTimestampMillisecond {
#[inline]
fn clone(&self) -> UnixTimestampMillisecond {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for UnixTimestampMillisecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for UnixTimestampMillisecond {
#[inline]
fn eq(&self, other: &UnixTimestampMillisecond) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for UnixTimestampMillisecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
1079pub struct UnixTimestampMillisecond {
1080/// Whether the `+` sign must be present for a non-negative timestamp.
1081pub(crate) sign_is_mandatory: bool,
1082}
10831084impl UnixTimestampMillisecond {
1085#[doc =
r" Set whether the `+` sign is mandatory for non-negative timestamps."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
1086/// Set whether the `+` sign is mandatory for non-negative timestamps.
1087fn with_sign_is_mandatory(sign_is_mandatory: bool);
1088 }1089}
10901091/// A Unix timestamp in microseconds.
1092#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UnixTimestampMicrosecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnixTimestampMicrosecond", "sign_is_mandatory",
&&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for UnixTimestampMicrosecond {
#[inline]
fn clone(&self) -> UnixTimestampMicrosecond {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for UnixTimestampMicrosecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for UnixTimestampMicrosecond {
#[inline]
fn eq(&self, other: &UnixTimestampMicrosecond) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for UnixTimestampMicrosecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
1093pub struct UnixTimestampMicrosecond {
1094/// Whether the `+` sign must be present for a non-negative timestamp.
1095pub(crate) sign_is_mandatory: bool,
1096}
10971098impl UnixTimestampMicrosecond {
1099#[doc =
r" Set whether the `+` sign is mandatory for non-negative timestamps."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
1100/// Set whether the `+` sign is mandatory for non-negative timestamps.
1101fn with_sign_is_mandatory(sign_is_mandatory: bool);
1102 }1103}
11041105/// A Unix timestamp in nanoseconds.
1106#[derive(#[automatically_derived]
impl ::core::fmt::Debug for UnixTimestampNanosecond {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnixTimestampNanosecond", "sign_is_mandatory",
&&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for UnixTimestampNanosecond {
#[inline]
fn clone(&self) -> UnixTimestampNanosecond {
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for UnixTimestampNanosecond { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for UnixTimestampNanosecond {
#[inline]
fn eq(&self, other: &UnixTimestampNanosecond) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for UnixTimestampNanosecond {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
1107pub struct UnixTimestampNanosecond {
1108/// Whether the `+` sign must be present for a non-negative timestamp.
1109pub(crate) sign_is_mandatory: bool,
1110}
11111112impl UnixTimestampNanosecond {
1113#[doc =
r" Set whether the `+` sign is mandatory for non-negative timestamps."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
1114/// Set whether the `+` sign is mandatory for non-negative timestamps.
1115fn with_sign_is_mandatory(sign_is_mandatory: bool);
1116 }1117}
11181119/// A Unix timestamp.
1120#[non_exhaustive]
1121#[allow(deprecated)]
1122#[deprecated(
1123 since = "0.3.48",
1124 note = "use `UnixTimestampSeconds`, `UnixTimestampMilliseconds`, `UnixTimestampMicroseconds`, \
1125 or `UnixTimestampNanoseconds` instead"
1126)]
1127#[derive(#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for UnixTimestamp {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "UnixTimestamp",
"precision", &self.precision, "sign_is_mandatory",
&&self.sign_is_mandatory)
}
}Debug, #[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for UnixTimestamp {
#[inline]
fn clone(&self) -> UnixTimestamp {
let _: ::core::clone::AssertParamIsClone<UnixTimestampPrecision>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for UnixTimestamp { }Copy, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::PartialEq for UnixTimestamp {
#[inline]
fn eq(&self, other: &UnixTimestamp) -> bool {
self.sign_is_mandatory == other.sign_is_mandatory &&
self.precision == other.precision
}
}PartialEq, #[automatically_derived]
#[allow(deprecated)]
impl ::core::cmp::Eq for UnixTimestamp {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<UnixTimestampPrecision>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
1128pub struct UnixTimestamp {
1129/// The precision of the timestamp.
1130pub precision: UnixTimestampPrecision,
1131/// Whether the `+` sign must be present for a non-negative timestamp.
1132pub sign_is_mandatory: bool,
1133}
11341135#[expect(deprecated)]
1136impl UnixTimestamp {
1137#[doc =
r" Set whether the `+` sign is mandatory for non-negative timestamps."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Self {
Self { sign_is_mandatory, ..self }
}builder_methods! {
1138/// Set the precision of the timestamp.
1139fn with_precision(precision: UnixTimestampPrecision);
1140/// Set whether the `+` sign is mandatory for non-negative timestamps.
1141fn with_sign_is_mandatory(sign_is_mandatory: bool);
1142 }1143}
11441145/// Whether trailing input after the declared end is permitted.
1146#[derive(#[automatically_derived]
impl ::core::fmt::Debug for TrailingInput {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
TrailingInput::Prohibit => "Prohibit",
TrailingInput::Discard => "Discard",
})
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for TrailingInput {
#[inline]
fn clone(&self) -> TrailingInput { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for TrailingInput { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for TrailingInput {
#[inline]
fn eq(&self, other: &TrailingInput) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for TrailingInput {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
1147pub enum TrailingInput {
1148/// Trailing input is not permitted and will cause an error.
1149Prohibit,
1150/// Trailing input is permitted but discarded.
1151Discard,
1152}
11531154/// The end of input.
1155#[non_exhaustive]
1156#[derive(#[automatically_derived]
impl ::core::fmt::Debug for End {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "End",
"trailing_input", &&self.trailing_input)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for End {
#[inline]
fn clone(&self) -> End {
let _: ::core::clone::AssertParamIsClone<TrailingInput>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for End { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for End {
#[inline]
fn eq(&self, other: &End) -> bool {
self.trailing_input == other.trailing_input
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for End {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<TrailingInput>;
}
}Eq)]
1157pub struct End {
1158/// How to handle any input after this component.
1159pub(crate) trailing_input: TrailingInput,
1160}
11611162impl End {
1163#[doc = r" Set how to handle any input after this component."]
#[allow(clippy :: needless_update, reason =
"needed for types with multiple fields")]
#[inline]
#[must_use =
"this returns the result of the operation, without modifying the original"]
pub const fn with_trailing_input(self, trailing_input: TrailingInput)
-> Self {
Self { trailing_input, ..self }
}builder_methods! {
1164/// Set how to handle any input after this component.
1165fn with_trailing_input(trailing_input: TrailingInput);
1166 }1167}