pub trait RuntimeSubstExt: Sealed + Sized {
// Required methods
fn with_tcp_provider<T>(
&self,
new_tcp: T,
) -> CompoundRuntime<Self, Self, Self, T, Self, Self, Self>;
fn with_sleep_provider<T>(
&self,
new_sleep: T,
) -> CompoundRuntime<Self, T, Self, Self, Self, Self, Self>;
fn with_coarse_time_provider<T>(
&self,
new_coarse_time: T,
) -> CompoundRuntime<Self, Self, T, Self, Self, Self, Self>;
}
Expand description
Extension trait on Runtime: Construct new Runtimes that replace part of an original runtime.
(If you need to do more complicated versions of this, you should likely construct CompoundRuntime directly.)
Required Methods§
Sourcefn with_tcp_provider<T>(
&self,
new_tcp: T,
) -> CompoundRuntime<Self, Self, Self, T, Self, Self, Self>
fn with_tcp_provider<T>( &self, new_tcp: T, ) -> CompoundRuntime<Self, Self, Self, T, Self, Self, Self>
Return a new runtime wrapping this runtime, but replacing its TCP NetStreamProvider.
Sourcefn with_sleep_provider<T>(
&self,
new_sleep: T,
) -> CompoundRuntime<Self, T, Self, Self, Self, Self, Self>
fn with_sleep_provider<T>( &self, new_sleep: T, ) -> CompoundRuntime<Self, T, Self, Self, Self, Self, Self>
Return a new runtime wrapping this runtime, but replacing its SleepProvider.
Sourcefn with_coarse_time_provider<T>(
&self,
new_coarse_time: T,
) -> CompoundRuntime<Self, Self, T, Self, Self, Self, Self>
fn with_coarse_time_provider<T>( &self, new_coarse_time: T, ) -> CompoundRuntime<Self, Self, T, Self, Self, Self, Self>
Return a new runtime wrapping this runtime, but replacing its CoarseTimeProvider.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.