Struct devtools_traits::PreciseTime
source · pub struct PreciseTime(pub(crate) u64);
Expand description
A replacement for time::PreciseTime
that isn’t opaque, so we can serialize it.
The reason why this doesn’t go upstream is that time
is slated to be part of Rust’s standard
library, which definitely can’t have any dependencies on serde
. But serde
can’t implement
Deserialize
and Serialize
itself, because time::PreciseTime
is opaque! A Catch-22. So I’m
duplicating the definition here.
Tuple Fields§
§0: u64
Implementations§
source§impl PreciseTime
impl PreciseTime
pub fn now() -> PreciseTime
pub fn to(&self, later: PreciseTime) -> Duration
Trait Implementations§
source§impl Clone for PreciseTime
impl Clone for PreciseTime
source§fn clone(&self) -> PreciseTime
fn clone(&self) -> PreciseTime
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PreciseTime
impl Debug for PreciseTime
source§impl<'de> Deserialize<'de> for PreciseTime
impl<'de> Deserialize<'de> for PreciseTime
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 Serialize for PreciseTime
impl Serialize for PreciseTime
impl Copy for PreciseTime
Auto Trait Implementations§
impl RefUnwindSafe for PreciseTime
impl Send for PreciseTime
impl Sync for PreciseTime
impl Unpin for PreciseTime
impl UnwindSafe for PreciseTime
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