#[repr(C)]pub struct IconProviderHandle {
pub inner: Box<IconProviderInner>,
}Expand description
Icon provider stored in AppConfig.
This is a Box
Icons are stored in a nested map: pack_name → (icon_name → RefAny) This allows:
- Multiple packs with different sources (app-images, material-icons, etc.)
- Easy unregistration of entire packs
- First-match-wins lookup across all packs
Fields§
§inner: Box<IconProviderInner>Boxed inner data - Box
Implementations§
Source§impl IconProviderHandle
impl IconProviderHandle
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty icon provider with the default (no-op) resolver.
Note: The default resolver in core crate returns an empty StyledDom.
Use set_resolver() to set a proper resolver from the layout crate,
or use with_resolver() to create with a custom resolver.
Sourcepub fn with_resolver(resolver: IconResolverCallbackType) -> Self
pub fn with_resolver(resolver: IconResolverCallbackType) -> Self
Create with a custom resolver callback
Sourcepub fn set_resolver(&mut self, resolver: IconResolverCallbackType)
pub fn set_resolver(&mut self, resolver: IconResolverCallbackType)
Set the resolver callback
Sourcepub fn register_icon(&mut self, pack_name: &str, icon_name: &str, data: RefAny)
pub fn register_icon(&mut self, pack_name: &str, icon_name: &str, data: RefAny)
Register a single icon in a pack (creates pack if needed).
Note: pack_name is case-sensitive, while icon_name is normalized to lowercase.
Sourcepub fn unregister_icon(&mut self, pack_name: &str, icon_name: &str)
pub fn unregister_icon(&mut self, pack_name: &str, icon_name: &str)
Unregister a single icon from a pack
Sourcepub fn unregister_pack(&mut self, pack_name: &str)
pub fn unregister_pack(&mut self, pack_name: &str)
Unregister an entire icon pack
Sourcepub fn lookup(&self, icon_name: &str) -> Option<RefAny>
pub fn lookup(&self, icon_name: &str) -> Option<RefAny>
Look up an icon across all packs (first match wins)
Sourcepub fn list_packs(&self) -> Vec<String>
pub fn list_packs(&self) -> Vec<String>
List all pack names
Sourcepub fn list_icons_in_pack(&self, pack_name: &str) -> Vec<String>
pub fn list_icons_in_pack(&self, pack_name: &str) -> Vec<String>
List all icon names in a specific pack
Sourcepub fn debug_lookup(&self, icon_name: &str) -> AzString
pub fn debug_lookup(&self, icon_name: &str) -> AzString
Debug lookup: returns detailed info about an icon’s RefAny contents