pub struct DateTime(/* private fields */);Expand description
Date and time (hours & minutes).
Implementations§
Source§impl DateTime
impl DateTime
Sourcepub fn into_local(&self) -> NaiveDateTime
pub fn into_local(&self) -> NaiveDateTime
Convert into naive local date and time.
Sourcepub fn from_local(local: &NaiveDateTime) -> Self
pub fn from_local(local: &NaiveDateTime) -> Self
Convert from naive local date and time.
Sourcepub fn from_rfc3339(rfc3339: &str) -> Result<Self, Error>
pub fn from_rfc3339(rfc3339: &str) -> Result<Self, Error>
Convert from naive RFC3339 date and time.
Trait Implementations§
Source§impl AddAssign<Duration> for DateTime
impl AddAssign<Duration> for DateTime
Source§fn add_assign(&mut self, other: Duration)
fn add_assign(&mut self, other: Duration)
Performs the
+= operation. Read moreSource§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 SubAssign<Duration> for DateTime
impl SubAssign<Duration> for DateTime
Source§fn sub_assign(&mut self, other: Duration)
fn sub_assign(&mut self, other: Duration)
Performs the
-= operation. Read moreimpl Copy for DateTime
impl Eq 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<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