pub struct Executor { /* private fields */ }
Implementations
sourceimpl Executor
impl Executor
sourcepub fn new(executor: TaskExecutor) -> Executor
pub fn new(executor: TaskExecutor) -> Executor
Executor for existing runtime.
Deprecated: Exists only to connect with current JSONRPC implementation.
sourcepub fn new_thread_per_future() -> Executor
pub fn new_thread_per_future() -> Executor
Spawns a new thread for each future (use only for tests).
sourcepub fn spawn<R>(&self, r: R) where
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
pub fn spawn<R>(&self, r: R) where
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
Spawn a future to this runtime
sourcepub fn spawn_fn<F, R>(&self, f: F) where
F: 'static + FnOnce() -> R + Send,
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
pub fn spawn_fn<F, R>(&self, f: F) where
F: 'static + FnOnce() -> R + Send,
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
Spawn a new future returned by given closure.
sourcepub fn spawn_with_timeout<F, R, T>(
&self,
f: F,
duration: Duration,
on_timeout: T
) where
T: 'static + FnOnce() + Send,
F: 'static + FnOnce() -> R + Send,
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
pub fn spawn_with_timeout<F, R, T>(
&self,
f: F,
duration: Duration,
on_timeout: T
) where
T: 'static + FnOnce() + Send,
F: 'static + FnOnce() -> R + Send,
R: 'static + IntoFuture<Item = (), Error = ()> + Send,
<R as IntoFuture>::Future: 'static,
<R as IntoFuture>::Future: Send,
Spawn a new future and wait for it or for a timeout to occur.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more