pub trait ComponentTheme:
Clone
+ Default
+ 'static {
// Required method
fn from_palette(palette: &Palette) -> Self;
}Expand description
组件主题 trait:每个内置组件的 FooTheme 实现它,从 Palette 派生本组件样式 slot。
约定:Self::default() 必须等价于 Self::from_palette(&Palette::default()),
这样「无 Provider 兜底」与「palette 派生」在解析链上收敛为同一实现。
Required Methods§
Sourcefn from_palette(palette: &Palette) -> Self
fn from_palette(palette: &Palette) -> Self
从共享调色板派生本组件主题。颜色一律取自 palette;高亮符号、DIM/BOLD
等非颜色决定由各组件在此承接。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".