pub struct VmTime(/* private fields */);
Expand description
Roughly analogous to std::time::Instant
, but for VM time.
Implementations§
Source§impl VmTime
impl VmTime
Sourcepub fn from_100ns(n: u64) -> Self
pub fn from_100ns(n: u64) -> Self
Converts from a time in 100ns units.
Sourcepub const fn as_100ns(&self) -> u64
pub const fn as_100ns(&self) -> u64
Gets the time from VM boot (or some other origin) in 100ns units.
Sourcepub fn wrapping_add(self, d: Duration) -> Self
pub fn wrapping_add(self, d: Duration) -> Self
Adds d
to the time.
Sourcepub fn is_before(self, t: Self) -> bool
pub fn is_before(self, t: Self) -> bool
Returns whether self
is before t
.
Note that this is a relative comparison in the 64-bit space and is not
transitive: if a
is before b
, and b
is before c
, a
still may
be after c
.
Sourcepub fn is_after(self, t: Self) -> bool
pub fn is_after(self, t: Self) -> bool
Returns whether self
is after t
.
See the comment about transitivity in Self::is_before
.
Sourcepub fn checked_sub(self, t: Self) -> Option<Duration>
pub fn checked_sub(self, t: Self) -> Option<Duration>
Returns the time between self
and t
, returning None
if self
is
before t
.
Trait Implementations§
Source§impl DefaultEncoding for VmTime
impl DefaultEncoding for VmTime
Source§type Encoding = TransparentEncoding<<u64 as DefaultEncoding>::Encoding>
type Encoding = TransparentEncoding<<u64 as DefaultEncoding>::Encoding>
The encoding to use for the serialization. Read more
Source§impl Transparent for VmTime
impl Transparent for VmTime
impl Copy for VmTime
impl Eq for VmTime
impl StructuralPartialEq for VmTime
Auto Trait Implementations§
impl Freeze for VmTime
impl RefUnwindSafe for VmTime
impl Send for VmTime
impl Sync for VmTime
impl Unpin for VmTime
impl UnwindSafe for VmTime
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