pub trait ConfigHandler {
// Required methods
fn claimed_categories(&self) -> Vec<CategoryClaim>;
fn handle_category(
&mut self,
category: &str,
name: &str,
properties: PropertyMap,
) -> Result<()>;
// Provided methods
fn claimed_properties(&self) -> HashMap<&str, &[&str]> { ... }
fn handle_properties(
&mut self,
_category: &str,
_name: &str,
_properties: PropertyMap,
) -> Result<()> { ... }
}Expand description
Handles configuration for one or more categories.
Required Methods§
Sourcefn claimed_categories(&self) -> Vec<CategoryClaim>
fn claimed_categories(&self) -> Vec<CategoryClaim>
Categories this handler owns, with optional selector filtering. A claim with no selector owns all definitions in that category. Multiple handlers may claim the same category only if all use selectors.
Sourcefn handle_category(
&mut self,
category: &str,
name: &str,
properties: PropertyMap,
) -> Result<()>
fn handle_category( &mut self, category: &str, name: &str, properties: PropertyMap, ) -> Result<()>
Handle a definition in an owned category. Properties claimed by other handlers will be excluded.
Provided Methods§
Sourcefn claimed_properties(&self) -> HashMap<&str, &[&str]>
fn claimed_properties(&self) -> HashMap<&str, &[&str]>
Properties this handler uses, keyed by category.
Category owners should include their own properties (under their own category)
to prevent other handlers from claiming them. Properties claimed on other
handlers’ categories will be split off and routed via handle_properties.
Sourcefn handle_properties(
&mut self,
_category: &str,
_name: &str,
_properties: PropertyMap,
) -> Result<()>
fn handle_properties( &mut self, _category: &str, _name: &str, _properties: PropertyMap, ) -> Result<()>
Handle claimed properties from a category this handler does not own.