[−][src]Struct icon_loader::Icon
Struct containing information about a themed icon.
Implementations
impl Icon
[src]
pub fn icon_name(&self) -> &str
[src]
Returns the associated icon's name.
pub fn theme_name(&self) -> &str
[src]
Returns the associated icon's theme name.
pub fn files(&self) -> &[IconFile]
[src]
Returns the icon files found for the associated icon.
pub fn file_for_size(&self, size: u16) -> &IconFile
[src]
Returns the file of the associated icon that fits the given size best. If there is no exact fit available, the next bigger one is chosen. If there is no bigger one, the next smaller is returned.
Arguments
size
- The ideal size of the returned icon file.
Example
use icon_loader::{IconLoader, IconType}; let loader = IconLoader::new(); if let Ok(icon) = loader.load_icon("minimum") { let icon_file = icon.file_for_size(32); }
pub fn file_for_size_filtered<F>(
&self,
size: u16,
filter: F
) -> Option<&IconFile> where
F: Fn(&IconFile) -> bool,
[src]
&self,
size: u16,
filter: F
) -> Option<&IconFile> where
F: Fn(&IconFile) -> bool,
Returns the file of the associated icon that fits the given size best and matches the provided filter. Use this, if you want only files of type PNG or anything like that.
Arguments
size
- The ideal size of the returned icon file.filter
- A function that takes a reference to anIconFile
and returns true, if it passes the test and false otherwise.
Example
use icon_loader::{IconLoader, IconType}; let loader = IconLoader::new(); if let Ok(icon) = loader.load_icon("minimum") { let icon_file = icon.file_for_size_filtered(32, |file| file.icon_type() == IconType::PNG); }
See also file_for_size
.
Trait Implementations
impl Clone for Icon
[src]
impl Debug for Icon
[src]
impl Eq for Icon
[src]
impl Hash for Icon
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Icon> for Icon
[src]
impl StructuralEq for Icon
[src]
impl StructuralPartialEq for Icon
[src]
Auto Trait Implementations
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnwindSafe for Icon
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,