pub struct FilterChain { /* private fields */ }Expand description
Composes multiple filters sequentially.
FilterChain::apply walks filters in order, feeding each
filter’s to_execute into the next. rejected accumulates across
the chain. FilterChain::default() is empty (no opinion — callers opt
in via DedupFilter or dedup_only()).
A chain plugs into the driver through the same trait it is made of:
TurnRunner::with_hook(gateway, executor, Arc::new(chain)).
Implementations§
Source§impl FilterChain
impl FilterChain
Sourcepub fn new(filters: Vec<Arc<dyn ToolUseHook>>) -> Self
pub fn new(filters: Vec<Arc<dyn ToolUseHook>>) -> Self
Build a chain from an explicit filter list. Order matters: the
first filter sees the raw batch, the next sees the previous
filter’s to_execute, etc.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True if the chain has no filters — in that case apply is a
pure passthrough.
Sourcepub fn dedup_only() -> Self
pub fn dedup_only() -> Self
Convenience: a chain containing only DedupFilter.
Sourcepub fn passthrough() -> Self
pub fn passthrough() -> Self
Convenience: an empty chain (pure passthrough). Equivalent to
FilterChain::new(vec![]) but documents intent.
Trait Implementations§
Source§impl Clone for FilterChain
impl Clone for FilterChain
Source§fn clone(&self) -> FilterChain
fn clone(&self) -> FilterChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more