pub struct ServerTime(/* private fields */);
Expand description
Stores the time difference between the server and the client to parse the response timestamps and to always be able to know the servers (timezoned) time without sending new requests to ask it
Implementations§
Source§impl ServerTime
impl ServerTime
Sourcepub fn current(&self) -> NaiveDateTime
pub fn current(&self) -> NaiveDateTime
The current time of the server in their time zone (whatever that might be). This uses the system time and calculates the offset to the servers time, so this is NOT the time at the last request, but the actual current time of the server.
pub fn next_midnight(&self) -> Duration
Trait Implementations§
Source§impl Clone for ServerTime
impl Clone for ServerTime
Source§fn clone(&self) -> ServerTime
fn clone(&self) -> ServerTime
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 ServerTime
impl Debug for ServerTime
Source§impl Default for ServerTime
impl Default for ServerTime
Source§fn default() -> ServerTime
fn default() -> ServerTime
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ServerTime
impl<'de> Deserialize<'de> for ServerTime
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 Ord for ServerTime
impl Ord for ServerTime
Source§fn cmp(&self, other: &ServerTime) -> Ordering
fn cmp(&self, other: &ServerTime) -> Ordering
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 PartialEq for ServerTime
impl PartialEq for ServerTime
Source§impl PartialOrd for ServerTime
impl PartialOrd for ServerTime
Source§impl Serialize for ServerTime
impl Serialize for ServerTime
impl Copy for ServerTime
impl Eq for ServerTime
impl StructuralPartialEq for ServerTime
Auto Trait Implementations§
impl Freeze for ServerTime
impl RefUnwindSafe for ServerTime
impl Send for ServerTime
impl Sync for ServerTime
impl Unpin for ServerTime
impl UnwindSafe for ServerTime
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.