pub trait BeholderFactory: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn version(&self) -> &'static str;
fn matches(&self, resolved_argv: &[String]) -> bool;
fn mode(&self) -> BeholderMode;
fn create(&self) -> Box<dyn Beholder>;
// Provided method
fn tool_version_range(&self) -> Option<ToolVersionRange> { ... }
}Expand description
Static descriptor + factory for a beholder type. Held in the registry.
create() produces a fresh, independent per-run instance each time.
Implementors should be stateless — all per-run state belongs in the
instance returned by create.
Required Methods§
fn name(&self) -> &'static str
fn version(&self) -> &'static str
Sourcefn matches(&self, resolved_argv: &[String]) -> bool
fn matches(&self, resolved_argv: &[String]) -> bool
Return true if this beholder handles the given invocation.
Receives the resolved argv (wrappers stripped). May inspect argv to
detect user-set conflicting flags (e.g. --message-format=human) and
return false to decline gracefully.
fn mode(&self) -> BeholderMode
Provided Methods§
Sourcefn tool_version_range(&self) -> Option<ToolVersionRange>
fn tool_version_range(&self) -> Option<ToolVersionRange>
Declared support range for the underlying tool’s structured output format.
Informational: surfaced in beholder_status when format drift is detected
so agents can see which version window the beholder was built for.
None means the beholder makes no version claim.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".