pub struct INSTANT_APP;
Expand description
App control of the INSTANT
service in an app context.
Implementations§
source§impl INSTANT_APP
impl INSTANT_APP
sourcepub fn set_mode(&self, mode: InstantMode)
pub fn set_mode(&self, mode: InstantMode)
Set how the app controls the time.
If mode is set to InstantMode::Now
the custom now is unset.
sourcepub fn advance_now(&self, advance: Duration)
pub fn advance_now(&self, advance: Duration)
Set the INSTANT.now
for the app threads to the current time plus advance
.
§Panics
Panics if the mode is not InstantMode::Manual
.
sourcepub fn custom_now(&self) -> Option<DInstant>
pub fn custom_now(&self) -> Option<DInstant>
Gets the custom now value.
This value is returned by INSTANT.now
if set.
sourcepub fn pause_for_update(&self) -> Option<InstantUpdatePause>
pub fn pause_for_update(&self) -> Option<InstantUpdatePause>
If mode is InstantMode::UpdatePaused
sets the app custom_now to the current time and returns
an object that unsets the custom now on drop.
Auto Trait Implementations§
impl Freeze for INSTANT_APP
impl RefUnwindSafe for INSTANT_APP
impl Send for INSTANT_APP
impl Sync for INSTANT_APP
impl Unpin for INSTANT_APP
impl UnwindSafe for INSTANT_APP
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more