pub struct LogosSpan {
pub months: i32,
pub days: i32,
}Expand description
Calendar span with separate month and day components.
Months and days are kept separate because they’re incommensurable:
- “1 month” is 28-31 days depending on the month
- You can’t convert months to days without knowing the reference date
Years fold into months (1 year = 12 months). Weeks fold into days (1 week = 7 days).
Fields§
§months: i32Total months (years * 12 + months)
days: i32Total days (weeks * 7 + days)
Implementations§
Source§impl LogosSpan
impl LogosSpan
Sourcepub fn from_years_months_days(years: i32, months: i32, days: i32) -> Self
pub fn from_years_months_days(years: i32, months: i32, days: i32) -> Self
Create a span from years, months, and days. Years are folded into months (1 year = 12 months).
Sourcepub fn from_weeks_days(weeks: i32, days: i32) -> Self
pub fn from_weeks_days(weeks: i32, days: i32) -> Self
Create a span from weeks and days. Weeks are folded into days (1 week = 7 days).
Trait Implementations§
Source§impl Add<LogosSpan> for LogosMoment
impl Add<LogosSpan> for LogosMoment
Source§type Output = LogosMoment
type Output = LogosMoment
The resulting type after applying the
+ operator.Source§impl Sub<LogosSpan> for LogosMoment
impl Sub<LogosSpan> for LogosMoment
Source§type Output = LogosMoment
type Output = LogosMoment
The resulting type after applying the
- operator.impl Copy for LogosSpan
impl Eq for LogosSpan
impl StructuralPartialEq for LogosSpan
Auto Trait Implementations§
impl Freeze for LogosSpan
impl RefUnwindSafe for LogosSpan
impl Send for LogosSpan
impl Sync for LogosSpan
impl Unpin for LogosSpan
impl UnsafeUnpin for LogosSpan
impl UnwindSafe for LogosSpan
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,
§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.