pub struct MockExtensionsProbeTool { /* private fields */ }test-utils only.Expand description
A mock tool that records whatever it observed in its per-call
ToolCallExtensions, so tests can assert the context reached tool execution.
call_with_extensions records session:<id> (or no-session when no
SessionId is present). The plain call body records call-no-context as
a sentinel: because an overridden call_with_extensions is the single dispatch
entry point, that sentinel must never surface from a dispatched run —
observing it would mean dispatch wrongly bypassed the context-aware path.
Implementations§
Trait Implementations§
Source§impl Clone for MockExtensionsProbeTool
impl Clone for MockExtensionsProbeTool
Source§fn clone(&self) -> MockExtensionsProbeTool
fn clone(&self) -> MockExtensionsProbeTool
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MockExtensionsProbeTool
impl Default for MockExtensionsProbeTool
Source§fn default() -> MockExtensionsProbeTool
fn default() -> MockExtensionsProbeTool
Source§impl Tool for MockExtensionsProbeTool
impl Tool for MockExtensionsProbeTool
Source§const NAME: &'static str = "context_probe"
const NAME: &'static str = "context_probe"
ToolSet or other registration scope that dispatches tools by name.Source§type Error = MockToolError
type Error = MockToolError
Source§fn description(&self) -> String
fn description(&self) -> String
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
Source§async fn call(&self, _args: Self::Args) -> Result<Self::Output, Self::Error>
async fn call(&self, _args: Self::Args) -> Result<Self::Output, Self::Error>
Source§async fn call_with_extensions(
&self,
_args: Self::Args,
extensions: &ToolCallExtensions,
) -> Result<Self::Output, Self::Error>
async fn call_with_extensions( &self, _args: Self::Args, extensions: &ToolCallExtensions, ) -> Result<Self::Output, Self::Error>
Source§fn classify_error(&self, error: &Self::Error) -> ToolFailure
fn classify_error(&self, error: &Self::Error) -> ToolFailure
ToolFailure. Read moreSource§fn call_structured(
&self,
args: Self::Args,
extensions: &ToolCallExtensions,
) -> impl Future<Output = Result<ToolReturn<Self::Output>, Self::Error>> + WasmCompatSend
fn call_structured( &self, args: Self::Args, extensions: &ToolCallExtensions, ) -> impl Future<Output = Result<ToolReturn<Self::Output>, Self::Error>> + WasmCompatSend
ToolReturn instead of a bare
output. Read moreAuto Trait Implementations§
impl Freeze for MockExtensionsProbeTool
impl RefUnwindSafe for MockExtensionsProbeTool
impl Send for MockExtensionsProbeTool
impl Sync for MockExtensionsProbeTool
impl Unpin for MockExtensionsProbeTool
impl UnsafeUnpin for MockExtensionsProbeTool
impl UnwindSafe for MockExtensionsProbeTool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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> 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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToolDyn for Twhere
T: Tool,
impl<T> ToolDyn for Twhere
T: Tool,
Source§fn call_structured<'a>(
&'a self,
args: String,
extensions: &'a ToolCallExtensions,
) -> Pin<Box<dyn Future<Output = ToolExecutionResult> + Send + 'a>>
fn call_structured<'a>( &'a self, args: String, extensions: &'a ToolCallExtensions, ) -> Pin<Box<dyn Future<Output = ToolExecutionResult> + Send + 'a>>
Routes through Tool::call_structured so rich returns
(ToolReturn) and Tool::classify_error are honored: a JSON
argument parse failure becomes an
InvalidArgs outcome, a returned
Err(Self::Error) is classified, and a successful ToolReturn is
serialized while preserving its outcome and extensions.