pub struct DateTime { /* private fields */ }Implementations§
Source§impl DateTime
impl DateTime
pub fn new( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, nano: u32, ) -> Option<Self>
pub fn from_ymd_hms( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, ) -> Result<Self, Box<TypeError>>
pub fn from_nanos(nanos: u64) -> Self
pub fn to_nanos(&self) -> u64
pub fn from_timestamp(timestamp: i64) -> Result<Self, Box<TypeError>>
pub fn from_timestamp_millis(millis: u64) -> Result<Self, Box<TypeError>>
pub fn from_timestamp_nanos(nanos: u128) -> Result<Self, Box<TypeError>>
pub fn timestamp(&self) -> i64
pub fn timestamp_millis(&self) -> i64
pub fn timestamp_nanos(&self) -> Result<i64, Box<TypeError>>
pub fn try_date(&self) -> Result<Date, Box<TypeError>>
pub fn date(&self) -> Date
pub fn time(&self) -> Time
pub fn to_nanos_since_epoch_u128(&self) -> u128
pub fn year(&self) -> i32
pub fn month(&self) -> u32
pub fn day(&self) -> u32
pub fn hour(&self) -> u32
pub fn minute(&self) -> u32
pub fn second(&self) -> u32
pub fn nanosecond(&self) -> u32
pub fn add_duration(&self, dur: &Duration) -> Result<Self, Box<TypeError>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DateTime
impl<'de> Deserialize<'de> for DateTime
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
Source§impl Ord for DateTime
impl Ord for DateTime
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 DateTime
impl PartialOrd for DateTime
Source§impl TryFromValue for DateTime
impl TryFromValue for DateTime
fn try_from_value(value: &Value) -> Result<Self, FromValueError>
fn from_value(value: &Value) -> Option<Self>
impl Copy for DateTime
impl Eq for DateTime
impl IsDate for DateTime
impl IsTemporal for DateTime
impl IsTime for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnsafeUnpin for DateTime
impl UnwindSafe for DateTime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more