pub struct TokioTimeProvider { /* private fields */ }Expand description
Real time provider using Tokio’s time facilities.
Implementations§
Source§impl TokioTimeProvider
impl TokioTimeProvider
Sourcepub fn new() -> TokioTimeProvider
pub fn new() -> TokioTimeProvider
Create a new Tokio time provider.
Trait Implementations§
Source§impl Clone for TokioTimeProvider
impl Clone for TokioTimeProvider
Source§fn clone(&self) -> TokioTimeProvider
fn clone(&self) -> TokioTimeProvider
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokioTimeProvider
impl Debug for TokioTimeProvider
Source§impl Default for TokioTimeProvider
impl Default for TokioTimeProvider
Source§fn default() -> TokioTimeProvider
fn default() -> TokioTimeProvider
Returns the “default value” for a type. Read more
Source§impl TimeProvider for TokioTimeProvider
impl TimeProvider for TokioTimeProvider
Source§fn sleep<'life0, 'async_trait>(
&'life0 self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SimulationError>> + 'async_trait>>where
'life0: 'async_trait,
TokioTimeProvider: 'async_trait,
fn sleep<'life0, 'async_trait>(
&'life0 self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SimulationError>> + 'async_trait>>where
'life0: 'async_trait,
TokioTimeProvider: 'async_trait,
Sleep for the specified duration. Read more
Source§fn timeout<'life0, 'async_trait, F, T>(
&'life0 self,
duration: Duration,
future: F,
) -> Pin<Box<dyn Future<Output = Result<Result<T, ()>, SimulationError>> + 'async_trait>>where
'life0: 'async_trait,
F: Future<Output = T> + 'async_trait,
T: 'async_trait,
TokioTimeProvider: 'async_trait,
fn timeout<'life0, 'async_trait, F, T>(
&'life0 self,
duration: Duration,
future: F,
) -> Pin<Box<dyn Future<Output = Result<Result<T, ()>, SimulationError>> + 'async_trait>>where
'life0: 'async_trait,
F: Future<Output = T> + 'async_trait,
T: 'async_trait,
TokioTimeProvider: 'async_trait,
Run a future with a timeout. Read more
Auto Trait Implementations§
impl Freeze for TokioTimeProvider
impl RefUnwindSafe for TokioTimeProvider
impl Send for TokioTimeProvider
impl Sync for TokioTimeProvider
impl Unpin for TokioTimeProvider
impl UnwindSafe for TokioTimeProvider
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)