pub trait CallbackInvoker {
type Error;
// Required method
fn invoke(
&self,
plan: &RoutingPlan,
payloads: &[PayloadEnvelope],
) -> Result<CallbackResponse, Self::Error>;
}Expand description
Callback invocation seam.
Implemented by DefaultCallbackInvoker (in-process, callbacks.rs)
and SubprocessCallbackInvoker (process boundary, subprocess.rs).
The signature takes a RoutingPlan plus the optional
PayloadEnvelopes the caller is delivering and lets the
implementation destructure, so the seam stays free of any
protocol dependency.
The PayloadEnvelope::body is treated as opaque bytes/value —
implementations must not parse it.
Required Associated Types§
Required Methods§
Sourcefn invoke(
&self,
plan: &RoutingPlan,
payloads: &[PayloadEnvelope],
) -> Result<CallbackResponse, Self::Error>
fn invoke( &self, plan: &RoutingPlan, payloads: &[PayloadEnvelope], ) -> Result<CallbackResponse, Self::Error>
Invoke the client callback for a routed event.
payloads carries any PayloadEnvelopes the caller is
delivering alongside the event. The router does not inspect
payload bodies; the invoker may, but is not required to.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".