pub trait Capturer:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn tool_name(&self) -> &'static str;
fn render_pre(
&self,
ctx: &HookContext,
input: &Value,
) -> Option<DisplayEntry>;
// Provided methods
fn subscribes_to(&self) -> &'static [HookEvent] { ... }
fn pre_rewrite(&self, _ctx: &HookContext, _input: &Value) -> RewriteDecision { ... }
fn render_post(
&self,
_ctx: &HookContext,
_input: &Value,
_response: &Value,
) -> Option<DisplayEntryUpdate> { ... }
}Expand description
The contribution API. Every observed CC tool gets one Capturer impl in this crate’s source tree.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier; matches [capture.<name>] in config and the filter UI label.
Sourcefn render_pre(&self, ctx: &HookContext, input: &Value) -> Option<DisplayEntry>
fn render_pre(&self, ctx: &HookContext, input: &Value) -> Option<DisplayEntry>
Render a PreToolUse event. Return None to suppress (e.g. for noisy calls).
Provided Methods§
Sourcefn subscribes_to(&self) -> &'static [HookEvent]
fn subscribes_to(&self) -> &'static [HookEvent]
Which hook events this capturer wants. Default: both Pre and Post.
Sourcefn pre_rewrite(&self, _ctx: &HookContext, _input: &Value) -> RewriteDecision
fn pre_rewrite(&self, _ctx: &HookContext, _input: &Value) -> RewriteDecision
Optional rewrite. Default: passthrough. Only the Bash capturer overrides this in v0.1.
Sourcefn render_post(
&self,
_ctx: &HookContext,
_input: &Value,
_response: &Value,
) -> Option<DisplayEntryUpdate>
fn render_post( &self, _ctx: &HookContext, _input: &Value, _response: &Value, ) -> Option<DisplayEntryUpdate>
Render a PostToolUse event. Default: no update (Pre-only capturers).
The wrapper correlates Pre↔Post by tool_use_id and applies this update.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".