pub struct Time(pub DateTime<Utc>);Expand description
Custom time type that wraps chrono::DateTime and provides custom JSON serialization matching the format expected by the REST API.
Tuple Fields§
§0: DateTime<Utc>Implementations§
Source§impl Time
impl Time
Sourcepub fn from_unix(unix: i64, usec: i64) -> Option<Self>
pub fn from_unix(unix: i64, usec: i64) -> Option<Self>
Create a Time from unix timestamp and microseconds.
Returns None if the resulting timestamp is out of range.
Sourcepub fn unix_micro(&self) -> i64
pub fn unix_micro(&self) -> i64
Get the timestamp in microseconds
Sourcepub fn unix_milli(&self) -> i64
pub fn unix_milli(&self) -> i64
Get the timestamp in milliseconds
Trait Implementations§
impl Copy for Time
Source§impl<'de> Deserialize<'de> for Time
impl<'de> Deserialize<'de> for Time
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 Time
Source§impl Ord for Time
impl Ord for Time
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 PartialOrd for Time
impl PartialOrd for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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