pub struct ToolCallHandler { /* private fields */ }Expand description
Central tool call handler with integrated authorization.
Implementations§
Source§impl ToolCallHandler
impl ToolCallHandler
Sourcepub fn new(
policy: McpPolicy,
authorizer: Option<Authorizer>,
emitter: Arc<dyn DecisionEmitter>,
config: ToolCallHandlerConfig,
) -> Self
pub fn new( policy: McpPolicy, authorizer: Option<Authorizer>, emitter: Arc<dyn DecisionEmitter>, config: ToolCallHandlerConfig, ) -> Self
Create a new handler.
Sourcepub fn with_lifecycle_emitter(self, emitter: Arc<dyn LifecycleEmitter>) -> Self
pub fn with_lifecycle_emitter(self, emitter: Arc<dyn LifecycleEmitter>) -> Self
Set the lifecycle emitter for mandate.used events (P0-B).
Sourcepub fn handle_tool_call(
&self,
request: &JsonRpcRequest,
state: &mut PolicyState,
runtime_identity: Option<&ToolIdentity>,
mandate: Option<&MandateData>,
transaction_object: Option<&Value>,
) -> HandleResult
pub fn handle_tool_call( &self, request: &JsonRpcRequest, state: &mut PolicyState, runtime_identity: Option<&ToolIdentity>, mandate: Option<&MandateData>, transaction_object: Option<&Value>, ) -> HandleResult
Handle a tool call with full authorization and always-emit guarantee.
This is the main entry point that enforces invariant I1: exactly one decision event is emitted for every tool call attempt.
Auto Trait Implementations§
impl Freeze for ToolCallHandler
impl !RefUnwindSafe for ToolCallHandler
impl Send for ToolCallHandler
impl Sync for ToolCallHandler
impl Unpin for ToolCallHandler
impl !UnwindSafe for ToolCallHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more