pub trait Executor:
Send
+ Sync
+ 'static {
// Required method
fn execute_method<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn execute<'life0, 'async_trait>(
&'life0 self,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn execute_direct<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_request: &'life2 (dyn Any + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Sends a serialized payload to a PHP worker and returns the response.
Plugins call this; they never see the worker pool directly.
Required Methods§
Sourcefn execute_method<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_method<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send payload to a worker using a specific RPC method name.
Provided Methods§
Sourcefn execute<'life0, 'async_trait>(
&'life0 self,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
payload: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send payload to a worker and return the response bytes.
Uses the RPC method name “dispatch” by default.
Sourcefn execute_direct<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_request: &'life2 (dyn Any + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_direct<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_method: &'life1 str,
_request: &'life2 (dyn Any + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Direct dispatch — optimized for embed runtime.
Passes typed request data directly (no serialization). Returns
Err by default — callers should fall back to execute_method.
Only EmbedRuntime implements this; pipe/fork runtimes use the default.
Implementations on Foreign Types§
Source§impl<T: Executor + ?Sized> Executor for Arc<T>
Blanket impl: an Arc<dyn Executor> is also an Executor.
impl<T: Executor + ?Sized> Executor for Arc<T>
Blanket impl: an Arc<dyn Executor> is also an Executor.