pub struct Week { /* private fields */ }Expand description
A numbered week of a year, written and read as YYYY-Www. Which days
it covers depends on the WeekSystem.
Implementations§
Source§impl Week
impl Week
Sourcepub fn new(year: i32, week: u32) -> Result<Self, CalendarError>
pub fn new(year: i32, week: u32) -> Result<Self, CalendarError>
A week 1 to 53 of a four-digit year; whether the year has a week 53
is checked by Week::first_day.
§Errors
When the year or week is out of range.
pub fn year(self) -> i32
pub fn number(self) -> u32
Sourcepub fn first_day(self, system: WeekSystem) -> Result<Date, CalendarError>
pub fn first_day(self, system: WeekSystem) -> Result<Date, CalendarError>
The Monday (ISO) or Sunday (epi) the week starts on.
§Errors
Week 53 of a year with 52 weeks, or a week outside years 0 to 9999.
Trait Implementations§
impl Copy for Week
Source§impl<'de> Deserialize<'de> for Week
impl<'de> Deserialize<'de> for Week
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Week
Source§impl Ord for Week
impl Ord for Week
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Week
impl PartialOrd for Week
impl StructuralPartialEq for Week
Auto Trait Implementations§
impl Freeze for Week
impl RefUnwindSafe for Week
impl Send for Week
impl Sync for Week
impl Unpin for Week
impl UnsafeUnpin for Week
impl UnwindSafe for Week
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.