pub struct DynDateTime64(pub Tz, pub u64, pub usize);Expand description
Wrapper type for ClickHouse DateTime64 type with dynamic precision.
Tuple Fields§
§0: Tz§1: u64§2: usizeImplementations§
Source§impl DynDateTime64
impl DynDateTime64
Sourcepub fn from_seconds(seconds: i64, tz: Option<Arc<str>>) -> Self
pub fn from_seconds(seconds: i64, tz: Option<Arc<str>>) -> Self
§Panics
Panics if seconds is negative.
Sourcepub fn from_millis(ms: i64, tz: Option<Arc<str>>) -> Self
pub fn from_millis(ms: i64, tz: Option<Arc<str>>) -> Self
§Panics
Panics if milliseconds is negative.
Source§impl DynDateTime64
impl DynDateTime64
Sourcepub fn try_from_utc(
other: DateTime<Utc>,
precision: usize,
) -> Result<Self, TryFromIntError>
pub fn try_from_utc( other: DateTime<Utc>, precision: usize, ) -> Result<Self, TryFromIntError>
§Errors
Returns an error if the timestamp cannot be converted to a u64.
Source§impl DynDateTime64
impl DynDateTime64
Sourcepub fn try_from_tz(
other: DateTime<Tz>,
precision: usize,
) -> Result<Self, TryFromIntError>
pub fn try_from_tz( other: DateTime<Tz>, precision: usize, ) -> Result<Self, TryFromIntError>
§Errors
Returns an error if the timestamp cannot be converted to a u64.
Trait Implementations§
Source§impl Clone for DynDateTime64
impl Clone for DynDateTime64
Source§fn clone(&self) -> DynDateTime64
fn clone(&self) -> DynDateTime64
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DynDateTime64
impl Debug for DynDateTime64
Source§impl<'de> Deserialize<'de> for DynDateTime64
impl<'de> Deserialize<'de> for DynDateTime64
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const PRECISION: usize> From<DateTime64<PRECISION>> for DynDateTime64
impl<const PRECISION: usize> From<DateTime64<PRECISION>> for DynDateTime64
Source§fn from(value: DateTime64<PRECISION>) -> Self
fn from(value: DateTime64<PRECISION>) -> Self
Converts to this type from the input type.
Source§impl Hash for DynDateTime64
impl Hash for DynDateTime64
Source§impl PartialEq for DynDateTime64
impl PartialEq for DynDateTime64
Source§impl Serialize for DynDateTime64
impl Serialize for DynDateTime64
Source§impl TryFrom<DynDateTime64> for DateTime<FixedOffset>
impl TryFrom<DynDateTime64> for DateTime<FixedOffset>
Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
Source§fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
Performs the conversion.
Source§impl TryFrom<DynDateTime64> for DateTime<Tz>
impl TryFrom<DynDateTime64> for DateTime<Tz>
Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
Source§fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
Performs the conversion.
Source§impl TryFrom<DynDateTime64> for DateTime<Utc>
impl TryFrom<DynDateTime64> for DateTime<Utc>
Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
Source§fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
fn try_from(date: DynDateTime64) -> Result<Self, TryFromIntError>
Performs the conversion.
impl Copy for DynDateTime64
impl Eq for DynDateTime64
impl StructuralPartialEq for DynDateTime64
Auto Trait Implementations§
impl Freeze for DynDateTime64
impl RefUnwindSafe for DynDateTime64
impl Send for DynDateTime64
impl Sync for DynDateTime64
impl Unpin for DynDateTime64
impl UnwindSafe for DynDateTime64
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> 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.