pub trait StyleResolver {
// Required method
fn resolve(&self, role: StyleRole) -> Option<StyleBundle>;
// Provided method
fn revision(&self) -> u64 { ... }
}Expand description
Optional host policy for built-in or application-defined StyleRoles.
Returned bundles overlay the active StyleSheet defaults. Resolvers are
expected to be cheap and side-effect free. A resolver with interior mutable
policy should increment revision whenever its answers
change so measurement caches can invalidate.
Required Methods§
Sourcefn resolve(&self, role: StyleRole) -> Option<StyleBundle>
fn resolve(&self, role: StyleRole) -> Option<StyleBundle>
Resolve role, or return None to keep the stylesheet/default result.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".