pub trait DiscoveryStrategy: Send + Sync {
// Required methods
fn discover(&self, ctx: &DiscoveryContext) -> Vec<PathBuf>;
fn name(&self) -> &'static str;
// Provided method
fn discover_attributed(
&self,
ctx: &DiscoveryContext,
) -> (Vec<PathBuf>, Vec<(PathBuf, &'static str)>) { ... }
}Required Methods§
fn discover(&self, ctx: &DiscoveryContext) -> Vec<PathBuf>
Provided Methods§
Sourcefn discover_attributed(
&self,
ctx: &DiscoveryContext,
) -> (Vec<PathBuf>, Vec<(PathBuf, &'static str)>)
fn discover_attributed( &self, ctx: &DiscoveryContext, ) -> (Vec<PathBuf>, Vec<(PathBuf, &'static str)>)
Discovery plus which strategy surfaced each path.
The ensemble dedupes first-seen and used to throw the attribution away, which makes the universe ceiling undiagnosable: “never surfaced at all” and “surfaced but not selected” are different failures with different fixes (#130), and neither is visible from the selected set alone. The default is honest for a single strategy — everything it returns, it found — and only the ensemble needs to override it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".