pub trait PipelineAware {
// Required method
fn pipeline(&self) -> Option<&ToolPipeline>;
}Expand description
Capability to dispatch tools through a middleware pipeline.
When a pipeline is configured, tool calls flow through middleware layers (timeouts, output limiting, etc.) before reaching the registry.
§Implementors
LoopManagers— the framework’s default implementation.
§When to use
Use this trait bound when you need to dispatch a tool call through optional middleware.
ⓘ
async fn dispatch(runtime: &impl PipelineAware, ctx: ToolDispatchContext) {
if let Some(pipeline) = runtime.pipeline() {
pipeline.invoke(ctx).await
} else {
// direct dispatch
}
}Required Methods§
Sourcefn pipeline(&self) -> Option<&ToolPipeline>
fn pipeline(&self) -> Option<&ToolPipeline>
Returns the tool middleware pipeline, if configured.
Returns None when no pipeline is set — tool calls go directly
to the registry. When set, every tool call passes through the
pipeline’s middleware layers before reaching the tool.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".