Struct TokioExecutor
#[non_exhaustive]
pub struct TokioExecutor {}
Future executor that utilises tokio threads.
Spawned futures do not inherit the current tracing span, even when the
tracing feature is enabled. To propagate spans, wrap this executor in
one of the components from rt::tracing, such as
CurrentSpanExecutor (available with
the tracing feature).
See the module-level documentation of rt::tracing
for more information about propagating tracing spans to spawned tasks.
The temporary rt-tracing-exec-force feature restores propagation of the
current span for libraries that do not allow customizing their executor.
It is excluded from full and may be removed in a future breaking release.
Implementations
impl TokioExecutor
fn new() -> SelfCreate new executor that relies on
tokio::spawnto execute futures.
Trait Implementations
impl Clone for TokioExecutor
fn clone(&self) -> Self
impl Debug for TokioExecutor
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for TokioExecutor
fn default() -> Self
impl<Fut> Executor<Fut> for TokioExecutor
where
Fut: Future + Send + 'static,
Fut::Output: Send + 'static,
fn execute(&self, fut: Fut)
Auto Trait Implementations
impl Freeze for TokioExecutor
impl RefUnwindSafe for TokioExecutor
impl Send for TokioExecutor
impl Sync for TokioExecutor
impl Unpin for TokioExecutor
impl UnsafeUnpin for TokioExecutor
impl UnwindSafe for TokioExecutor
Blanket Implementations
impl<A, B, T> HttpServerConnExec<A, B> for TokioExecutor
where
B: Body,
T: Http2ServerConnExec<A, B>,
impl<E, B, T> Http2ClientConnExec<B, T> for TokioExecutor
where
E: Clone + Executor<H2ClientFuture<B, T, E>> + Http2UpgradedExec<<B as Body>::Data>,
B: Body + 'static,
<B as Body>::Error: Into<Box<dyn Error + Sync + Send>>,
H2ClientFuture<B, T, E>: Future<Output = ()>,
T: Read + Write + Unpin,
fn execute_h2_future(&mut self, future: H2ClientFuture<B, T, E>)
impl<E, F, B> Http2ServerConnExec<F, B> for TokioExecutor
where
E: Clone + Executor<H2Stream<F, B, E>> + Http2UpgradedExec<<B as Body>::Data>,
H2Stream<F, B, E>: Future<Output = ()>,
B: Body,
fn execute_h2stream(&mut self, fut: H2Stream<F, B, E>)
impl<T> Any for TokioExecutor
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for TokioExecutor
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for TokioExecutor
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for TokioExecutor
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for TokioExecutor
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for TokioExecutor
impl<T> ToOwned for TokioExecutor
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> WithSubscriber for TokioExecutor
impl<T, U> Into<U> for TokioExecutor
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for TokioExecutor
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for TokioExecutor
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>