pub fn load_custom_icon(
provider: &(impl IconProvider + ?Sized),
set: IconSet,
) -> Option<IconData>Expand description
Load an icon from any IconProvider, dispatching through the standard
platform loading chain.
§Fallback chain
- Provider’s
icon_name()– passed to platform system loader viaload_system_icon_by_name() - Provider’s
icon_svg()– bundled SVG data None– no cross-set fallback (mixing icon sets is forbidden)
§Examples
use native_theme::{load_custom_icon, IconRole, IconSet};
// IconRole implements IconProvider, so it works with load_custom_icon
let icon = load_custom_icon(&IconRole::ActionCopy, IconSet::Material);
assert!(icon.is_some());