[][src]Struct cassiopeia::Time

pub struct Time { /* fields omitted */ }

A convenience wrapper around DateTime with fixed timezone

Implementations

impl Time[src]

pub fn now() -> Self[src]

Get the current local time and pin it to a fixed Tz offset

pub fn after(&self, date: &Date) -> bool[src]

Check if a time stamp happened after a date

pub fn round(&self) -> Self[src]

Return a new instance that is rounded to nearest 15 minutes

It uses the internally provided offset to do rounding, meaning that the timezone information will not change, even when rounding values that were created in a different timezone.

pub fn hour(&self) -> u32[src]

pub fn minute(&self) -> u32[src]

pub fn second(&self) -> u32[src]

Trait Implementations

impl Clone for Time[src]

impl Debug for Time[src]

impl Eq for Time[src]

impl From<DateTime<FixedOffset>> for Time[src]

impl Ord for Time[src]

impl PartialEq<Time> for Time[src]

impl PartialOrd<Time> for Time[src]

impl StructuralEq for Time[src]

impl StructuralPartialEq for Time[src]

impl<'t> Sub<&'t Time> for &'t Time[src]

type Output = Duration

The resulting type after applying the - operator.

impl ToString for Time[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.