#[non_exhaustive]pub struct Year {
pub padding: Padding,
pub repr: YearRepr,
pub range: YearRange,
pub iso_week_based: bool,
pub sign_is_mandatory: bool,
}use one of the various Year* components instead
cookies and (crate features formatting or parsing) only.Expand description
Year of the date.
Fields (Non-exhaustive)ยง
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.padding: Paddinguse one of the various Year* components instead
The padding to obtain the minimum width.
repr: YearRepruse one of the various Year* components instead
What kind of representation should be used?
range: YearRangeuse one of the various Year* components instead
What range of years is supported?
iso_week_based: booluse one of the various Year* components instead
Whether the value is based on the ISO week number or the Gregorian calendar.
sign_is_mandatory: booluse one of the various Year* components instead
Whether the + sign is present when a non-negative year contains fewer digits than
necessary.
Implementationsยง
Sourceยงimpl Year
impl Year
Sourcepub const fn default() -> Year
pub const fn default() -> Year
Creates a modifier that indicates the value uses the Full
representation, is padded with zeroes, uses the Gregorian calendar as its
base, and only includes the yearโs sign if necessary.
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.
Sourceยงimpl Year
impl Year
Sourcepub const fn with_padding(self, padding: Padding) -> Year
pub const fn with_padding(self, padding: Padding) -> Year
Set the padding type.
Sourcepub const fn with_repr(self, repr: YearRepr) -> Year
pub const fn with_repr(self, repr: YearRepr) -> Year
Set the manner in which the year is represented.
Sourcepub const fn with_range(self, range: YearRange) -> Year
pub const fn with_range(self, range: YearRange) -> Year
Set the range of years that are supported.
Sourcepub const fn with_iso_week_based(self, iso_week_based: bool) -> Year
pub const fn with_iso_week_based(self, iso_week_based: bool) -> Year
Set whether the year is based on the ISO week number.
Sourcepub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Year
pub const fn with_sign_is_mandatory(self, sign_is_mandatory: bool) -> Year
Set whether the + sign is mandatory for positive years with fewer than five digits.
Trait Implementationsยง
impl Copy for Year
Sourceยงimpl Default for Year
Creates a modifier that indicates the value uses the Full
representation, is padded with zeroes, uses the Gregorian calendar as its
base, and only includes the yearโs sign if necessary.
impl Default for Year
Creates a modifier that indicates the value uses the Full
representation, is padded with zeroes, uses the Gregorian calendar as its
base, and only includes the yearโs sign if necessary.
impl Eq for Year
impl StructuralPartialEq for Year
Auto Trait Implementationsยง
impl Freeze for Year
impl RefUnwindSafe for Year
impl Send for Year
impl Sync for Year
impl Unpin for Year
impl UnsafeUnpin for Year
impl UnwindSafe for Year
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.