pub struct Time { /* private fields */ }Implementations§
Source§impl Time
impl Time
pub fn new(hour: u32, min: u32, sec: u32, nano: u32) -> Option<Self>
pub fn from_hms(hour: u32, min: u32, sec: u32) -> Result<Self, Box<TypeError>>
pub fn from_hms_nano( hour: u32, min: u32, sec: u32, nano: u32, ) -> Result<Self, Box<TypeError>>
pub fn midnight() -> Self
pub fn noon() -> Self
pub fn hour(&self) -> u32
pub fn minute(&self) -> u32
pub fn second(&self) -> u32
pub fn nanosecond(&self) -> u32
pub fn to_nanos_since_midnight(&self) -> u64
pub fn from_nanos_since_midnight(nanos: u64) -> Option<Self>
pub fn saturating_add(self, rhs: Duration) -> Time
pub fn saturating_sub(self, rhs: Duration) -> Time
Trait Implementations§
impl Copy for Time
Source§impl<'de> Deserialize<'de> for Time
impl<'de> Deserialize<'de> for Time
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Time
impl IsTemporal for Time
impl IsTime for Time
Source§impl Ord for Time
impl Ord for Time
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl StructuralPartialEq for Time
Source§impl TryFromValue for Time
impl TryFromValue for Time
fn try_from_value(value: &Value) -> Result<Self, FromValueError>
fn from_value(value: &Value) -> Option<Self>
Source§impl TryFromValueCoerce for Time
impl TryFromValueCoerce for Time
fn try_from_value_coerce(value: &Value) -> Result<Self, FromValueError>
fn from_value_coerce(value: &Value) -> Option<Self>
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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
Mutably borrows from an owned value. Read more