pub enum DateItem {
Date(Date),
DateTime(PrimitiveDateTime),
DateTimeTz(OffsetDateTime),
}
Variants§
Implementations§
Source§impl DateItem
impl DateItem
pub fn add_timezone(self, offset: UtcOffset) -> Option<Self>
pub fn timestamp(self) -> i64
pub fn time_since(self) -> i64
pub fn to_datetime_tz(self) -> OffsetDateTime
pub fn format(self) -> Result<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DateItem
impl<'de> Deserialize<'de> for DateItem
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 From<OffsetDateTime> for DateItem
impl From<OffsetDateTime> for DateItem
Source§fn from(datetime_tz: OffsetDateTime) -> Self
fn from(datetime_tz: OffsetDateTime) -> Self
Converts to this type from the input type.
Source§impl From<PrimitiveDateTime> for DateItem
impl From<PrimitiveDateTime> for DateItem
Source§fn from(datetime: PrimitiveDateTime) -> Self
fn from(datetime: PrimitiveDateTime) -> Self
Converts to this type from the input type.
impl Copy for DateItem
impl Eq for DateItem
impl StructuralPartialEq for DateItem
Auto Trait Implementations§
impl Freeze for DateItem
impl RefUnwindSafe for DateItem
impl Send for DateItem
impl Sync for DateItem
impl Unpin for DateItem
impl UnwindSafe for DateItem
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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