pub struct DateTime { /* private fields */ }Implementations§
Source§impl DateTime
impl DateTime
pub fn new( year: i64, month: u8, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32, timezone: Timezone, ) -> Option<Self>
Sourcepub fn from_date_time(date: Date, time: Time) -> Option<Self>
pub fn from_date_time(date: Date, time: Time) -> Option<Self>
Create a DateTimeWithoutTimezone from a DateWithoutTimezone and TimeWithoutTimezone.
pub fn date(&self) -> DateWithoutTimezone
pub fn time(&self) -> TimeWithoutTimezone
pub fn year(&self) -> i64
pub fn month(&self) -> u8
pub fn day(&self) -> u8
pub fn hour(&self) -> u8
pub fn minute(&self) -> u8
pub fn second(&self) -> u8
pub fn nanosecond(&self) -> u32
pub fn truncate_minutes(&self, minutes: u8) -> Self
Trait Implementations§
Source§impl AmadeusOrd for DateTime
impl AmadeusOrd for DateTime
fn amadeus_cmp(&self, other: &Self) -> Ordering
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 Display for DateTime
Corresponds to RFC 3339 and ISO 8601 string %Y-%m-%dT%H:%M:%S%.9f%:z
impl Display for DateTime
Corresponds to RFC 3339 and ISO 8601 string %Y-%m-%dT%H:%M:%S%.9f%:z
Source§impl DowncastFrom<Value> for DateTime
impl DowncastFrom<Value> for DateTime
fn downcast_from(self_: Value) -> Result<Self, DowncastError>
Source§impl Ord for DateTime
impl Ord for DateTime
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
impl 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 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<A, B> Downcast<A> for Bwhere
A: DowncastFrom<B>,
impl<A, B> Downcast<A> for Bwhere
A: DowncastFrom<B>,
fn downcast(self) -> Result<A, DowncastError>
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> 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