pub struct ExecutorLayer<E> { /* private fields */ }Expand description
A Tower layer that delegates request processing to an executor.
This layer wraps a service and spawns each request’s processing as a new task on the provided executor. This enables parallel processing of requests across multiple executor threads.
§Example
use tower_resilience_executor::ExecutorLayer;
use tokio::runtime::Handle;
// Use the current runtime
let layer = ExecutorLayer::new(Handle::current());Implementations§
Source§impl<E> ExecutorLayer<E>where
E: Executor,
impl<E> ExecutorLayer<E>where
E: Executor,
Sourcepub fn builder() -> ExecutorLayerBuilder<E>
pub fn builder() -> ExecutorLayerBuilder<E>
Creates a builder for configuring the executor layer.
Trait Implementations§
Source§impl<E: Clone> Clone for ExecutorLayer<E>
impl<E: Clone> Clone for ExecutorLayer<E>
Source§fn clone(&self) -> ExecutorLayer<E>
fn clone(&self) -> ExecutorLayer<E>
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 moreAuto Trait Implementations§
impl<E> Freeze for ExecutorLayer<E>where
E: Freeze,
impl<E> RefUnwindSafe for ExecutorLayer<E>where
E: RefUnwindSafe,
impl<E> Send for ExecutorLayer<E>where
E: Send,
impl<E> Sync for ExecutorLayer<E>where
E: Sync,
impl<E> Unpin for ExecutorLayer<E>where
E: Unpin,
impl<E> UnsafeUnpin for ExecutorLayer<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for ExecutorLayer<E>where
E: UnwindSafe,
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