pub trait RuntimeFactory: Runtime {
type Mutex<T: Send + 'static>: MutexLike<T>;
type Notify: NotifyLike;
type JoinSet<T: Send + 'static>: JoinSetLike<T>;
type Sleep: Future<Output = ()> + Send;
// Required methods
fn new_mutex<T: Send + 'static>(value: T) -> Self::Mutex<T>;
fn new_notify() -> Self::Notify;
fn new_join_set<T: Send + 'static>() -> Self::JoinSet<T>;
fn sleep(duration: Duration) -> Self::Sleep;
}Expand description
Sibling extension of Runtime: typed factory methods for the
per-session sync / task / time primitives. Implemented by every
concrete runtime that ships in the workspace (TokioPerCoreRuntime,
PrimeRuntime). Consumers bound on R: RuntimeFactory when they
need typed primitives; consumers that only need to spawn stay on
R: Runtime and the trait stays dyn-compatible.
Required Associated Types§
type Mutex<T: Send + 'static>: MutexLike<T>
type Notify: NotifyLike
type JoinSet<T: Send + 'static>: JoinSetLike<T>
Required Methods§
fn new_mutex<T: Send + 'static>(value: T) -> Self::Mutex<T>
fn new_notify() -> Self::Notify
fn new_join_set<T: Send + 'static>() -> Self::JoinSet<T>
fn sleep(duration: Duration) -> Self::Sleep
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".