#[repr(transparent)]pub struct DateTime<U = Nanosecond>(pub i64, _)
where
U: TimeUnitTrait;Tuple Fields§
§0: i64Implementations§
source§impl<U> DateTime<U>where
U: TimeUnitTrait,
impl<U> DateTime<U>where
U: TimeUnitTrait,
pub fn new(dt: i64) -> DateTime<U>
pub fn is_nat(&self) -> bool
pub fn is_not_nat(&self) -> bool
pub fn nat() -> DateTime<U>
pub fn into_i64(self) -> i64
pub fn from_opt_i64(v: Option<i64>) -> DateTime<U>
pub fn into_opt_i64(self) -> Option<i64>
pub fn to_cr(&self) -> Option<DateTime<Utc>>
pub fn parse(s: &str, fmt: Option<&str>) -> Result<DateTime<U>, TError>
pub fn strftime(&self, fmt: Option<&str>) -> String
pub fn duration_trunc(self, duration: TimeDelta) -> DateTime<U>
source§impl<U> DateTime<U>where
U: TimeUnitTrait,
impl<U> DateTime<U>where
U: TimeUnitTrait,
pub fn into_unit<T>(self) -> DateTime<T>where
T: TimeUnitTrait,
Trait Implementations§
source§impl Cast<DateTime<Microsecond>> for DateTime<Nanosecond>
impl Cast<DateTime<Microsecond>> for DateTime<Nanosecond>
fn cast(self) -> DateTime<Microsecond>
source§impl Cast<DateTime<Microsecond>> for DateTime<Millisecond>
impl Cast<DateTime<Microsecond>> for DateTime<Millisecond>
fn cast(self) -> DateTime<Microsecond>
source§impl Cast<DateTime<Microsecond>> for DateTime<Second>
impl Cast<DateTime<Microsecond>> for DateTime<Second>
fn cast(self) -> DateTime<Microsecond>
source§impl Cast<DateTime<Millisecond>> for DateTime<Nanosecond>
impl Cast<DateTime<Millisecond>> for DateTime<Nanosecond>
fn cast(self) -> DateTime<Millisecond>
source§impl Cast<DateTime<Millisecond>> for DateTime<Microsecond>
impl Cast<DateTime<Millisecond>> for DateTime<Microsecond>
fn cast(self) -> DateTime<Millisecond>
source§impl Cast<DateTime<Millisecond>> for DateTime<Second>
impl Cast<DateTime<Millisecond>> for DateTime<Second>
fn cast(self) -> DateTime<Millisecond>
source§impl<U> Default for DateTime<U>where
U: TimeUnitTrait,
impl<U> Default for DateTime<U>where
U: TimeUnitTrait,
source§impl<U> From<NaiveDateTime> for DateTime<U>
impl<U> From<NaiveDateTime> for DateTime<U>
source§fn from(dt: NaiveDateTime) -> DateTime<U>
fn from(dt: NaiveDateTime) -> DateTime<U>
Converts to this type from the input type.
source§impl<U: TimeUnitTrait> GetDataType for DateTime<U>
impl<U: TimeUnitTrait> GetDataType for DateTime<U>
source§impl<Unit: TimeUnitTrait> IsNone for DateTime<Unit>
impl<Unit: TimeUnitTrait> IsNone for DateTime<Unit>
type Inner = DateTime<Unit>
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn map<F, U: IsNone>(self, f: F) -> U
fn from_opt(opt: Option<Self::Inner>) -> Self
fn not_none(&self) -> bool
source§impl<U> Ord for DateTime<U>where
U: Ord + TimeUnitTrait,
impl<U> Ord for DateTime<U>where
U: Ord + TimeUnitTrait,
1.21.0 · 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<U> PartialOrd for DateTime<U>where
U: PartialOrd + TimeUnitTrait,
impl<U> PartialOrd for DateTime<U>where
U: PartialOrd + TimeUnitTrait,
impl<U> Copy for DateTime<U>where
U: Copy + TimeUnitTrait,
impl<U> Eq for DateTime<U>where
U: Eq + TimeUnitTrait,
impl<U> Send for DateTime<U>where
U: TimeUnitTrait,
impl<U> StructuralPartialEq for DateTime<U>where
U: TimeUnitTrait,
impl<U> Sync for DateTime<U>where
U: TimeUnitTrait,
Auto Trait Implementations§
impl<U> Freeze for DateTime<U>
impl<U> RefUnwindSafe for DateTime<U>where
U: RefUnwindSafe,
impl<U> Unpin for DateTime<U>where
U: Unpin,
impl<U> UnwindSafe for DateTime<U>where
U: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)