Enum costoflife::Lifetime
source · [−]pub enum Lifetime {
SingleDay,
Year {
amount: i64,
times: i64,
},
Month {
amount: i64,
times: i64,
},
Week {
amount: i64,
times: i64,
},
Day {
amount: i64,
times: i64,
},
}
Expand description
A time range with duration and repetition
Variants
SingleDay
Year
Month
Week
Day
Implementations
sourceimpl Lifetime
impl Lifetime
sourcepub fn get_days_since(&self, since: &NaiveDate) -> i64
pub fn get_days_since(&self, since: &NaiveDate) -> i64
Returns the number of days from a given date.
This is significant con calculate the exact amount of days considering months and leap years
sourcepub fn get_repeats(&self) -> i64
pub fn get_repeats(&self) -> i64
Get the number of duration repeats for the current lifetime
Trait Implementations
sourceimpl FromStr for Lifetime
impl FromStr for Lifetime
type Err = CostOfLifeError
type Err = CostOfLifeError
The associated error which can be returned from parsing.
impl Copy for Lifetime
Auto Trait Implementations
impl RefUnwindSafe for Lifetime
impl Send for Lifetime
impl Sync for Lifetime
impl Unpin for Lifetime
impl UnwindSafe for Lifetime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more