[−][src]Struct pgdatetime::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]
s: &str,
type_mod: i32,
date_order: DateOrder
) -> Result<Time, DateTimeError>
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]
&self,
ty: FieldType,
unit: DateUnit
) -> Result<Option<f64>, DateTimeError>
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.
fn is_infinite(&self) -> bool
[src]
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Time
[src]
fn cmp(&self, other: &Time) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Time> for Time
[src]
impl PartialOrd<Time> for Time
[src]
fn partial_cmp(&self, other: &Time) -> Option<Ordering>
[src]
fn lt(&self, other: &Time) -> bool
[src]
fn le(&self, other: &Time) -> bool
[src]
fn gt(&self, other: &Time) -> bool
[src]
fn ge(&self, other: &Time) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,