pub struct TokioExecutor { /* private fields */ }
Implementations§
Source§impl TokioExecutor
impl TokioExecutor
pub fn new(rt: Handle) -> TokioExecutor
Sourcepub fn block_on_any<F: Future>(&self, future: F) -> F::Output
pub fn block_on_any<F: Future>(&self, future: F) -> F::Output
Block on the current task safely. Usually regular tokio block_on panics if it is already on the tokio task. This allows block on tokio task, using spawn_blocking. Note: This only works on multi-threaded runtime.
Sourcepub fn block_until_ctrlc(&self)
pub fn block_until_ctrlc(&self)
Block the current thread until Ctrl+C is received. This is typically used in SF app main function.
Trait Implementations§
Source§impl Clone for TokioExecutor
impl Clone for TokioExecutor
Source§fn clone(&self) -> TokioExecutor
fn clone(&self) -> TokioExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Executor for TokioExecutor
impl Executor for TokioExecutor
Source§fn spawn<F>(&self, future: F)
fn spawn<F>(&self, future: F)
spawns the task to run in background, and returns a join handle
where the future’s result can be awaited.
If the future panics, the join handle should return an error code.
This is primarily used by mssf Bridge to execute user app async callbacks/notifications.
User app impl future may panic, and mssf propagates panic as an error in JoinHandle
to SF.
Auto Trait Implementations§
impl Freeze for TokioExecutor
impl RefUnwindSafe for TokioExecutor
impl Send for TokioExecutor
impl Sync for TokioExecutor
impl Unpin for TokioExecutor
impl UnwindSafe for TokioExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more