pub struct Executor<'a> {
async_io: Option<Arc<Executor<'a>>>,
}Expand description
A wrapper around the underlying runtime/executor.
This is used to run asynchronous tasks internally and allows integration with various runtimes.
See crate::Connection::executor for an example of integration with external runtimes.
Note: You can (and should) completely ignore this type when the tokio backend is in use.
Fields§
§async_io: Option<Arc<Executor<'a>>>Implementations§
Source§impl Executor<'_>
impl Executor<'_>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Return true if there are no unfinished tasks.
With the tokio backend in use, this always returns true.
Sourcepub async fn tick(&self)
pub async fn tick(&self)
Runs a single task.
With the tokio backend in use, it’s a noop and never returns.
Sourcepub(crate) fn needs_internal_driver(&self) -> bool
pub(crate) fn needs_internal_driver(&self) -> bool
Whether this executor needs an external driver thread (only the async-io backend does).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Executor<'a>
impl<'a> RefUnwindSafe for Executor<'a>
impl<'a> Send for Executor<'a>
impl<'a> Sync for Executor<'a>
impl<'a> Unpin for Executor<'a>
impl<'a> UnsafeUnpin for Executor<'a>
impl<'a> UnwindSafe for Executor<'a>
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