pub struct IconCache<'a> {
pub bytes: &'a [u8],
pub header: &'a Header,
pub hash: &'a Hash,
pub directory_list: DirectoryList<'a>,
}Expand description
Fields§
§bytes: &'a [u8]The raw bytes representing the cache
header: &'a HeaderCache header file: contains version and hash & directory list offsets
hash: &'a HashInternal hash table storing mapping from icon names to icon information
directory_list: DirectoryList<'a>List of directories within the theme, relative to the theme’s root
Implementations§
Source§impl<'a> IconCache<'a>
impl<'a> IconCache<'a>
pub fn new_from_bytes(bytes: &'a [u8]) -> Result<Self, Box<dyn Error + 'a>>
Sourcepub fn icon(&self, icon_name: impl AsRef<[u8]>) -> Option<Icon<'a>>
pub fn icon(&self, icon_name: impl AsRef<[u8]>) -> Option<Icon<'a>>
Look up an icon by name in the cache. icon_name accepts any type that turns into a byte
slice: typically str suffices.
Returns None if no icon by that name exists within the icon theme, or if parsing failed.
pub fn iter(&self) -> impl Iterator<Item = Icon<'a>>
Trait Implementations§
impl<'a> Copy for IconCache<'a>
Auto Trait Implementations§
impl<'a> Freeze for IconCache<'a>
impl<'a> RefUnwindSafe for IconCache<'a>
impl<'a> Send for IconCache<'a>
impl<'a> Sync for IconCache<'a>
impl<'a> Unpin for IconCache<'a>
impl<'a> UnwindSafe for IconCache<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more