pub(crate) struct WeekCalculator {
first_weekday: Weekday,
min_week_days: u8,
}Fields§
§first_weekday: Weekday§min_week_days: u8Implementations§
Source§impl WeekCalculator
impl WeekCalculator
pub(crate) const ISO: Self
Sourcefn weekday_index(self, weekday: Weekday) -> i8
fn weekday_index(self, weekday: Weekday) -> i8
Returns the zero based index of weekday vs this calendar’s start of week.
Sourcepub(crate) fn week_of(
self,
num_days_in_previous_unit: u16,
num_days_in_unit: u16,
day: u16,
week_day: Weekday,
) -> Result<WeekOf, RangeError>
pub(crate) fn week_of( self, num_days_in_previous_unit: u16, num_days_in_unit: u16, day: u16, week_day: Weekday, ) -> Result<WeekOf, RangeError>
Computes & returns the week of given month/year according to calendar.
§Arguments
- calendar: Calendar information used to compute the week number.
- num_days_in_previous_unit: The number of days in the preceding month/year.
- num_days_in_unit: The number of days in the month/year.
- day: 1-based day of month/year.
- week_day: The weekday of
day..
§Error
If num_days_in_unit/num_days_in_previous_unit < MIN_UNIT_DAYS
Trait Implementations§
Source§impl Clone for WeekCalculator
impl Clone for WeekCalculator
Source§fn clone(&self) -> WeekCalculator
fn clone(&self) -> WeekCalculator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WeekCalculator
impl Debug for WeekCalculator
impl Copy for WeekCalculator
Auto Trait Implementations§
impl Freeze for WeekCalculator
impl RefUnwindSafe for WeekCalculator
impl Send for WeekCalculator
impl Sync for WeekCalculator
impl Unpin for WeekCalculator
impl UnsafeUnpin for WeekCalculator
impl UnwindSafe for WeekCalculator
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