pub struct CallExecutor { /* private fields */ }Expand description
Executes MXP Call messages by invoking registered tools and the
configured ModelAdapter.
Implementations§
Source§impl CallExecutor
impl CallExecutor
Sourcepub fn new(adapter: Arc<dyn ModelAdapter>, tools: Arc<ToolRegistry>) -> Self
pub fn new(adapter: Arc<dyn ModelAdapter>, tools: Arc<ToolRegistry>) -> Self
Creates a new call executor.
Sourcepub fn set_policy(&mut self, policy: Arc<dyn PolicyEngine>)
pub fn set_policy(&mut self, policy: Arc<dyn PolicyEngine>)
Configures the policy engine used for governance decisions.
Sourcepub fn with_policy(self, policy: Arc<dyn PolicyEngine>) -> Self
pub fn with_policy(self, policy: Arc<dyn PolicyEngine>) -> Self
Configures the policy engine, returning the updated executor for chaining.
Sourcepub fn policy(&self) -> Option<&Arc<dyn PolicyEngine>>
pub fn policy(&self) -> Option<&Arc<dyn PolicyEngine>>
Returns the policy engine if one has been configured.
Sourcepub fn set_policy_observer(&mut self, observer: Arc<dyn PolicyObserver>)
pub fn set_policy_observer(&mut self, observer: Arc<dyn PolicyObserver>)
Installs a policy observer for integration hooks.
Sourcepub fn with_policy_observer(self, observer: Arc<dyn PolicyObserver>) -> Self
pub fn with_policy_observer(self, observer: Arc<dyn PolicyObserver>) -> Self
Configures a policy observer, returning the updated executor for chaining.
Sourcepub fn policy_observer(&self) -> Option<&Arc<dyn PolicyObserver>>
pub fn policy_observer(&self) -> Option<&Arc<dyn PolicyObserver>>
Returns the policy observer if configured.
Sourcepub async fn execute(&self, ctx: &HandlerContext) -> HandlerResult<CallOutcome>
pub async fn execute(&self, ctx: &HandlerContext) -> HandlerResult<CallOutcome>
Executes the call pipeline using data extracted from the handler context.
§Errors
Returns HandlerError when payload decoding, tool execution, or model
inference fails.
Trait Implementations§
Source§impl Clone for CallExecutor
impl Clone for CallExecutor
Source§fn clone(&self) -> CallExecutor
fn clone(&self) -> CallExecutor
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 Freeze for CallExecutor
impl !RefUnwindSafe for CallExecutor
impl Send for CallExecutor
impl Sync for CallExecutor
impl Unpin for CallExecutor
impl !UnwindSafe for CallExecutor
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