pub trait ThemeProvider: Send + Sync {
// Required method
fn current_system_theme(&self) -> Result<Theme, HostApiError>;
}Expand description
提供宿主当前实际生效主题的平台能力。
由平台层实现并注入 HostApi,PluginHandle 仅负责向插件转发查询结果。
Required Methods§
Sourcefn current_system_theme(&self) -> Result<Theme, HostApiError>
fn current_system_theme(&self) -> Result<Theme, HostApiError>
查询当前系统主题;宿主显式配置的 light/dark 由 HostApi 在上层优先处理。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".