[][src]Struct pgdatetime::Time

#[repr(transparent)]pub struct Time(_);

Time of day (no date).

Implementations

impl Time[src]

pub const fn new() -> Self[src]

Construct a Time value.

pub fn try_from_hms(h: i32, m: i32, s: f64) -> Result<Time, DateTimeError>[src]

Constructs Time use hour, minute and second. second can indicate milliseconds an microseconds THe min unit is microseconds.

pub fn try_from_str(
    s: &str,
    type_mod: i32,
    date_order: DateOrder
) -> Result<Time, DateTimeError>
[src]

Parses Time string. type_mod should be 0 ~ 6, else will have no affect.

pub fn format(self, date_style: DateStyle) -> Result<String, DateTimeError>[src]

Converts Time to string.

pub fn add_interval(self, span: Interval) -> Time[src]

Time Adds Interval.

pub fn sub_time(self, time: Time) -> Interval[src]

Time subtracts Time

pub fn sub_interval(self, span: Interval) -> Time[src]

Time subtracts Interval.

Trait Implementations

impl Clone for Time[src]

impl Copy for Time[src]

impl DateTime for Time[src]

fn date_part(
    &self,
    ty: FieldType,
    unit: DateUnit
) -> Result<Option<f64>, DateTimeError>
[src]

Extracts specified field from time type.

fn is_finite(&self) -> bool[src]

Checks whether Time is finite.

fn truncate(&self, ty: FieldType, unit: DateUnit) -> Result<Self, DateTimeError>[src]

Truncates Time to specified units.

impl Debug for Time[src]

impl Eq for Time[src]

impl From<Interval> for Time[src]

Converts Interval to Time. This is defined as producing the fractional-day portion of the interval. Therefore, we can just ignore the months field. It is not real clear what to do with negative intervals, but we choose to subtract the floor, so that, say, '-2 hours' becomes '22:00:00'.

impl From<Time> for Interval[src]

Converts Time to Interval.

impl From<Time> for i64[src]

Converts Time to i64 type.

impl From<i64> for Time[src]

Converts i64 to Date to type.

impl Hash 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]

Auto Trait Implementations

impl RefUnwindSafe for Time

impl Send for Time

impl Sync for Time

impl Unpin for Time

impl UnwindSafe for Time

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.