pub trait WeightProvider<Sc: Score>: Send + Sync {
// Required method
fn weight(&self, name: &str) -> Option<Sc>;
// Provided method
fn weight_or_default(&self, name: &str, default: Sc) -> Sc { ... }
}Expand description
Helper trait for creating weight functions from overrides.
This enables zero-erasure constraint building with runtime weight lookup.
Required Methods§
Provided Methods§
Sourcefn weight_or_default(&self, name: &str, default: Sc) -> Sc
fn weight_or_default(&self, name: &str, default: Sc) -> Sc
Gets the weight or returns the default.