Struct tor_rtmock::MockSleepRuntime [−][src]
pub struct MockSleepRuntime<R: Runtime> { /* fields omitted */ }
Expand description
A wrapper Runtime that overrides the SleepProvider trait for the underlying runtime.
Implementations
Create a new runtime that wraps runtime, but overrides
its view of time with a MockSleepProvider.
Return a reference to the MockSleepProvider
Trait Implementations
type SleepFuture = Sleeping
type SleepFuture = SleepingA future returned by SleepProvider::sleep()
Return a future that will be ready after duration has
elapsed. Read more
Return the SleepProvider’s view of the current wall-clock time. Read more
The type for the TCP connections returned by Self::connect().
type TcpListener = R::TcpListener
type TcpListener = R::TcpListenerThe type for the TCP listeners returned by Self::listen().
Launch a TCP connection to a given socket address. Read more
fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = IoResult<Self::TcpListener>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = IoResult<Self::TcpListener>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, Open a TCP listener on a given socket address.
Auto Trait Implementations
impl<R> RefUnwindSafe for MockSleepRuntime<R> where
R: RefUnwindSafe, impl<R> Send for MockSleepRuntime<R>impl<R> Sync for MockSleepRuntime<R>impl<R> Unpin for MockSleepRuntime<R> where
R: Unpin, impl<R> UnwindSafe for MockSleepRuntime<R> where
R: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
Pause until the wall-clock is at when or later, trying to
recover from clock jumps. Read more
impl<Sp> SpawnExt for Sp where
Sp: Spawn + ?Sized,
impl<Sp> SpawnExt for Sp where
Sp: Spawn + ?Sized, impl<T> Runtime for T where
T: Sync + Send + Spawn + SpawnBlocking + Clone + SleepProvider + TcpProvider + TlsProvider + 'static,