pub trait SourceProvider {
// Required methods
fn discover_features(&self) -> Result<Vec<String>, ProviderError>;
fn discover_packs(&self) -> Result<Vec<String>, ProviderError>;
fn discover_fragments(&self) -> Result<Vec<String>, ProviderError>;
fn read(&self, name: &str) -> Result<Arc<str>, ProviderError>;
}Expand description
Discovers and reads the feature files and macro packs of one suite.
Source names are filesystem paths rendered as strings — the identity used
by Diag.source_name and PackSource.name throughout the pipeline. read
returns raw bytes; normalization (BOM strip, trailing newline) is the
parser’s job, so spans stay consistent with the CLI.
Required Methods§
Sourcefn discover_features(&self) -> Result<Vec<String>, ProviderError>
fn discover_features(&self) -> Result<Vec<String>, ProviderError>
Every feature source name under the suite, in the order the provider finds them.
Sourcefn discover_packs(&self) -> Result<Vec<String>, ProviderError>
fn discover_packs(&self) -> Result<Vec<String>, ProviderError>
Every macro pack source name under the suite, in the order the provider finds them.
Sourcefn discover_fragments(&self) -> Result<Vec<String>, ProviderError>
fn discover_fragments(&self) -> Result<Vec<String>, ProviderError>
Every engine-native fragment file a pack may ref: (ADR-0018).
Return an empty vec when the provider serves no fragments.
Deliberately not defaulted. Every implementation lives in this
workspace, so a default body buys no compatibility — and it cost the
feature once already: a delegating wrapper that forwarded the other two
discoveries silently inherited “no fragments”, so the editor reported
every ref: as unknown_ref while the same suite ran green. A required
method makes a forwarding provider fail to compile instead.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".