pub struct CalendarGrid {
pub origin: i64,
pub first_day: i64,
pub last_day: i64,
pub monday_first: bool,
}Expand description
The calendar grid shared by StatCalendar and geom_calendar: which
day is column 0 / row 0, and the (clipped) first/last day.
Fields§
§origin: i64First day of week 0 (a Sunday, or a Monday when monday_first).
first_day: i64§last_day: i64§monday_first: boolImplementations§
Source§impl CalendarGrid
impl CalendarGrid
Sourcepub fn from_days(
days: impl Iterator<Item = i64>,
monday_first: bool,
) -> Option<(Self, bool)>
pub fn from_days( days: impl Iterator<Item = i64>, monday_first: bool, ) -> Option<(Self, bool)>
Grid over the given day numbers, clipped to the last
MAX_CALENDAR_YEARS years. Returns the grid and whether it clipped.
Sourcepub fn row(&self, day: i64) -> i64
pub fn row(&self, day: i64) -> i64
Row position of a day: the first weekday is the top row (y = 6).
pub fn n_weeks(&self) -> i64
pub fn contains(&self, day: i64) -> bool
Trait Implementations§
Source§impl Clone for CalendarGrid
impl Clone for CalendarGrid
impl Copy for CalendarGrid
Auto Trait Implementations§
impl Freeze for CalendarGrid
impl RefUnwindSafe for CalendarGrid
impl Send for CalendarGrid
impl Sync for CalendarGrid
impl Unpin for CalendarGrid
impl UnsafeUnpin for CalendarGrid
impl UnwindSafe for CalendarGrid
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