pub trait ComplexityIntrospect {
// Required method
fn complexity_class(&self) -> ComplexityClass;
// Provided method
fn complexity_detail(&self) -> &'static str { ... }
}Expand description
Object-safe runtime introspection. Defaulting impl<T: Complexity> so any
type with a static Complexity impl gets ComplexityIntrospect for free,
and a dyn ComplexityIntrospect query works on solver trait objects.
fn within_budget(s: &dyn ComplexityIntrospect, max: ComplexityClass) -> bool {
s.complexity_class() <= max
}