pub struct NumericDate(/* private fields */);Expand description
JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds.
See: https://datatracker.ietf.org/doc/html/rfc7519#section-2
Implementations§
Source§impl NumericDate
impl NumericDate
Sourcepub fn as_seconds(self) -> f64
pub fn as_seconds(self) -> f64
Return the f64-valued number of seconds represented by this NumericDate.
Sourcepub fn try_from_seconds(
seconds: f64,
) -> Result<Self, NumericDateConversionError>
pub fn try_from_seconds( seconds: f64, ) -> Result<Self, NumericDateConversionError>
Try to create NumericDate from a f64 value, returning error upon out-of-range.
Trait Implementations§
Source§impl Add<TimeDelta> for NumericDate
Note that this will panic if the addition goes out-of-range.
impl Add<TimeDelta> for NumericDate
Note that this will panic if the addition goes out-of-range.
Source§impl Clone for NumericDate
impl Clone for NumericDate
Source§fn clone(&self) -> NumericDate
fn clone(&self) -> NumericDate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NumericDate
Source§impl Debug for NumericDate
impl Debug for NumericDate
Source§impl<'de> Deserialize<'de> for NumericDate
impl<'de> Deserialize<'de> for NumericDate
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
impl Eq for NumericDate
Source§impl From<DateTime<FixedOffset>> for NumericDate
impl From<DateTime<FixedOffset>> for NumericDate
Source§fn from(dtfo: DateTime<FixedOffset>) -> Self
fn from(dtfo: DateTime<FixedOffset>) -> Self
Converts to this type from the input type.
Source§impl From<NumericDate> for DateTime<Utc>
impl From<NumericDate> for DateTime<Utc>
Source§fn from(nd: NumericDate) -> Self
fn from(nd: NumericDate) -> Self
Converts to this type from the input type.
Source§impl From<NumericDate> for LocalResult<DateTime<Utc>>
impl From<NumericDate> for LocalResult<DateTime<Utc>>
Source§fn from(nd: NumericDate) -> Self
fn from(nd: NumericDate) -> Self
Converts to this type from the input type.
Source§impl From<i32> for NumericDate
impl From<i32> for NumericDate
Source§impl FromStr for NumericDate
impl FromStr for NumericDate
Source§impl Hash for NumericDate
impl Hash for NumericDate
Source§impl Ord for NumericDate
impl Ord for NumericDate
Source§fn cmp(&self, other: &NumericDate) -> Ordering
fn cmp(&self, other: &NumericDate) -> Ordering
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 PartialEq for NumericDate
impl PartialEq for NumericDate
Source§fn eq(&self, other: &NumericDate) -> bool
fn eq(&self, other: &NumericDate) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NumericDate
impl PartialOrd for NumericDate
Source§impl Serialize for NumericDate
impl Serialize for NumericDate
impl StructuralPartialEq for NumericDate
Source§impl Sub for NumericDate
Note that this will panic if the addition goes out-of-range.
impl Sub for NumericDate
Note that this will panic if the addition goes out-of-range.
Source§impl Sub<TimeDelta> for NumericDate
Note that this will panic if the addition goes out-of-range.
impl Sub<TimeDelta> for NumericDate
Note that this will panic if the addition goes out-of-range.
Source§impl TryFrom<f64> for NumericDate
impl TryFrom<f64> for NumericDate
Auto Trait Implementations§
impl Freeze for NumericDate
impl RefUnwindSafe for NumericDate
impl Send for NumericDate
impl Sync for NumericDate
impl Unpin for NumericDate
impl UnsafeUnpin for NumericDate
impl UnwindSafe for NumericDate
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
impl<T, U> DeserializeTypedOwned<T> for Uwhere
U: for<'de> DeserializeTyped<'de, T>,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
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§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.