pub trait TextThemeRole: Copy {
// Required method
fn resolve(self, theme: &Theme) -> TextStyle;
}Expand description
A typed role that resolves a TextStyle from a Theme.
This is the extension point of the theme system: an application defines its own role type and derives the style here, so the result keeps following theme overrides and light/dark selection. A role that needs a parameter carries it in the role value, and a role that needs data the theme cannot provide carries a reference to it.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.