Struct easy_time::EasyTime

source ·
pub struct EasyTime<F: TimeZone> {
    pub value: i64,
    pub time_now: DateTime<F>,
}

Fields§

§value: i64§time_now: DateTime<F>

Implementations§

source§

impl<F: TimeZone> EasyTime<F>

source

pub fn new(value: i64) -> EasyTime<Local>

source

pub fn new_with_utc(value: i64) -> EasyTime<Utc>

source

pub fn new_with_time(value: i64, time: DateTime<F>) -> EasyTime<F>

source

pub fn seconds_from_now(&self) -> DateTime<F>

source

pub fn seconds_ago(&self) -> DateTime<F>

source

pub fn minutes_from_now(&self) -> DateTime<F>

source

pub fn minutes_ago(&self) -> DateTime<F>

source

pub fn hours_from_now(&self) -> DateTime<F>

source

pub fn hours_ago(&self) -> DateTime<F>

source

pub fn days_from_now(&self) -> DateTime<F>

source

pub fn days_ago(&self) -> DateTime<F>

source

pub fn months_from_now(&self) -> DateTime<F>

source

pub fn months_ago(&self) -> DateTime<F>

source

pub fn years_from_now(&self) -> DateTime<F>

source

pub fn years_ago(&self) -> DateTime<F>

source

pub fn decades_from_now(&self) -> DateTime<F>

source

pub fn decades_ago(&self) -> DateTime<F>

source

pub fn centuries_from_now(&self) -> DateTime<F>

source

pub fn centuries_ago(&self) -> DateTime<F>

source

pub fn milleniums_from_now(&self) -> DateTime<F>

source

pub fn milleniums_ago(&self) -> DateTime<F>

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for EasyTime<F>where <F as TimeZone>::Offset: RefUnwindSafe,

§

impl<F> Send for EasyTime<F>where <F as TimeZone>::Offset: Send,

§

impl<F> Sync for EasyTime<F>where <F as TimeZone>::Offset: Sync,

§

impl<F> Unpin for EasyTime<F>where <F as TimeZone>::Offset: Unpin,

§

impl<F> UnwindSafe for EasyTime<F>where <F as TimeZone>::Offset: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.