Enum deadpool::managed::reexports::Runtime [−][src]
pub enum Runtime {
Tokio1,
AsyncStd1,
}
This is supported on crate feature
managed
only.Expand description
Enumeration for picking a runtime implementation.
Variants
This is supported on crate feature
rt_tokio_1
only.tokio
1.0 runtime.
This is supported on crate feature
rt_async-std_1
only.async-std
1.0 runtime.
Implementations
Requires a Future
to complete before the specified duration
has
elapsed.
If the future
completes before the duration
has elapsed, then the
completed value is returned. Otherwise, an error is returned and
the future
is canceled.
pub async fn spawn_blocking<F, R>(&self, f: F) -> Result<R, SpawnBlockingError> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
pub async fn spawn_blocking<F, R>(&self, f: F) -> Result<R, SpawnBlockingError> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
Runs the given closure on a thread where blocking is acceptable.
Errors
See SpawnBlockingError
for details.
pub fn spawn_blocking_background<F>(
&self,
f: F
) -> Result<(), SpawnBlockingError> where
F: FnOnce() + Send + 'static,
pub fn spawn_blocking_background<F>(
&self,
f: F
) -> Result<(), SpawnBlockingError> where
F: FnOnce() + Send + 'static,
Runs the given closure on a thread where blocking is acceptable.
It works similar to Runtime::spawn_blocking()
but doesn’t return a
Future
and is meant to be used for background tasks.
Errors
See SpawnBlockingError
for details.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Runtime
impl UnwindSafe for Runtime
Blanket Implementations
Mutably borrows from an owned value. Read more