#[non_exhaustive]pub struct WeekInformation {
pub first_weekday: Weekday,
pub weekend: WeekdaySet,
}
Expand description
Information about the first day of the week and the weekend.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.first_weekday: Weekday
The first day of a week.
weekend: WeekdaySet
The set of weekend days
Implementations§
Source§impl WeekInformation
impl WeekInformation
Sourcepub fn try_new(prefs: WeekPreferences) -> Result<WeekInformation, DataError>
pub fn try_new(prefs: WeekPreferences) -> Result<WeekInformation, DataError>
Creates a new [WeekCalculator
] from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: WeekPreferences,
) -> Result<WeekInformation, DataError>
pub fn try_new_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: WeekPreferences, ) -> Result<WeekInformation, DataError>
A version of [Self :: try_new
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_unstable<P>(
provider: &P,
prefs: WeekPreferences,
) -> Result<WeekInformation, DataError>
pub fn try_new_unstable<P>( provider: &P, prefs: WeekPreferences, ) -> Result<WeekInformation, DataError>
A version of Self::try_new
that uses custom data provided by a DataProvider
.
⚠️ The bounds on provider may change over time, including in SemVer minor releases.
Sourcepub fn weekend(self) -> WeekdaySetIterator ⓘ
pub fn weekend(self) -> WeekdaySetIterator ⓘ
Weekdays that are part of the ‘weekend’, for calendar purposes. Days may not be contiguous, and order is based off the first weekday.
Trait Implementations§
Source§impl Clone for WeekInformation
impl Clone for WeekInformation
Source§fn clone(&self) -> WeekInformation
fn clone(&self) -> WeekInformation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WeekInformation
impl Debug for WeekInformation
impl Copy for WeekInformation
Auto Trait Implementations§
impl Freeze for WeekInformation
impl RefUnwindSafe for WeekInformation
impl Send for WeekInformation
impl Sync for WeekInformation
impl Unpin for WeekInformation
impl UnwindSafe for WeekInformation
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more