Struct wall_clock::WallClockTime
source · pub struct WallClockTime { /* private fields */ }Expand description
A representation of a time, as read from a wall clock, independent of date or time zone.
Implementations§
source§impl WallClockTime
impl WallClockTime
sourcepub const fn new(hours: u8, minutes: u8, seconds: u8) -> Self
pub const fn new(hours: u8, minutes: u8, seconds: u8) -> Self
A new wall-clock time set to the provided hours, minutes, and seconds.
§Panic
Panics if any values are too high for a wall clock (hours >= 24, minutes >= 60, seconds >= 60). Wall clocks don’t know about leap seconds.
sourcepub const fn new_with_micros(
hours: u8,
minutes: u8,
seconds: u8,
micros: u32
) -> Self
pub const fn new_with_micros( hours: u8, minutes: u8, seconds: u8, micros: u32 ) -> Self
A new wall-clock time set to the provided hours, minutes, seconds, and microseconds.
§Panic
Panics if any values are too high for a wall clock (hours >= 24, minutes >= 60, seconds >= 60). Wall clocks don’t know about leap seconds.
sourcepub const fn new_midnight_offset(seconds: u32, micros: u32) -> Self
pub const fn new_midnight_offset(seconds: u32, micros: u32) -> Self
A new wall-clock time corresponding to the number of seconds and microseconds offset from midnight.
§Panic
Panics if any values are higher than is valid for a wall clock (seconds >= 86,400; micros >= 1,000,000).
sourcepub const fn microsecond(&self) -> u32
pub const fn microsecond(&self) -> u32
The number of microseconds since the last second.
Trait Implementations§
source§impl<'expr> AsExpression<Nullable<Time>> for &'expr WallClockTime
impl<'expr> AsExpression<Nullable<Time>> for &'expr WallClockTime
§type Expression = Bound<Nullable<Time>, &'expr WallClockTime>
type Expression = Bound<Nullable<Time>, &'expr WallClockTime>
source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
source§impl AsExpression<Nullable<Time>> for WallClockTime
impl AsExpression<Nullable<Time>> for WallClockTime
§type Expression = Bound<Nullable<Time>, WallClockTime>
type Expression = Bound<Nullable<Time>, WallClockTime>
source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
source§impl<'expr> AsExpression<Time> for &'expr WallClockTime
impl<'expr> AsExpression<Time> for &'expr WallClockTime
§type Expression = Bound<Time, &'expr WallClockTime>
type Expression = Bound<Time, &'expr WallClockTime>
source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
source§impl AsExpression<Time> for WallClockTime
impl AsExpression<Time> for WallClockTime
§type Expression = Bound<Time, WallClockTime>
type Expression = Bound<Time, WallClockTime>
source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
source§impl Clone for WallClockTime
impl Clone for WallClockTime
source§fn clone(&self) -> WallClockTime
fn clone(&self) -> WallClockTime
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for WallClockTime
impl Debug for WallClockTime
source§impl Default for WallClockTime
impl Default for WallClockTime
source§fn default() -> WallClockTime
fn default() -> WallClockTime
source§impl<'de> Deserialize<'de> for WallClockTime
impl<'de> Deserialize<'de> for WallClockTime
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl Display for WallClockTime
impl Display for WallClockTime
source§impl FromStr for WallClockTime
impl FromStr for WallClockTime
source§impl Ord for WallClockTime
impl Ord for WallClockTime
source§fn cmp(&self, other: &WallClockTime) -> Ordering
fn cmp(&self, other: &WallClockTime) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for WallClockTime
impl PartialEq for WallClockTime
source§fn eq(&self, other: &WallClockTime) -> bool
fn eq(&self, other: &WallClockTime) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for WallClockTime
impl PartialOrd for WallClockTime
source§fn partial_cmp(&self, other: &WallClockTime) -> Option<Ordering>
fn partial_cmp(&self, other: &WallClockTime) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl<__ST, __DB> Queryable<__ST, __DB> for WallClockTime
impl<__ST, __DB> Queryable<__ST, __DB> for WallClockTime
source§impl Serialize for WallClockTime
impl Serialize for WallClockTime
impl Copy for WallClockTime
impl Eq for WallClockTime
impl StructuralPartialEq for WallClockTime
Auto Trait Implementations§
impl Freeze for WallClockTime
impl RefUnwindSafe for WallClockTime
impl Send for WallClockTime
impl Sync for WallClockTime
impl Unpin for WallClockTime
impl UnwindSafe for WallClockTime
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
impl<T, ST, DB> FromSqlRow<ST, DB> for Twhere
T: Queryable<ST, DB>,
ST: SqlTypeOrSelectable,
DB: Backend,
<T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,
source§impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more