pub trait PresetSource: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn detect(&self, path: &Path) -> bool;
fn load(&self, path: &Path) -> Result<Value, PresetSourceError>;
}Expand description
Pluggable loader for a preset shape.
Implementations are stateless; a single instance is reused across loads. Detection is cheap and path-based so callers can probe multiple sources without incurring the cost of a full parse.
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
Short identifier used in error messages and logs (e.g., "yaml",
"toml").