[][src]Enum icon_loader::ThemeNameProvider

pub enum ThemeNameProvider {
    KDE,
    GTK,
    User(String),
    Custom(Box<dyn Fn() -> Result<String, Box<dyn StdError + Send + Sync>> + Send + Sync>),
}

Enum that provides a theme name to IconLoader. It can either load the system theme name from the KDE or GTK config files or provide a fixed string or provide a theme name yielded by a completely customizable function. The last option allows users to load their own config files for example.

Variants

KDE

Use the '~/.config/kdeglobals' file to determine the theme name.

GTK

Use the '~/.config/gtk-3.0/settings.ini' file to determine the theme name.

User(String)

A theme name provided by the user.

Custom(Box<dyn Fn() -> Result<String, Box<dyn StdError + Send + Sync>> + Send + Sync>)

A custom function that returns a theme name or an error.

Implementations

impl ThemeNameProvider[src]

pub fn user(string: impl Into<String>) -> Self[src]

Creates a new ThemeNameProvider that provides the given string as theme name.

pub fn custom<F, S, E>(f: F) -> Self where
    F: Fn() -> Result<S, E> + Send + Sync + 'static,
    S: Into<String>,
    E: StdError + Send + Sync + 'static, 
[src]

Creates a new custom ThemeNameProvider from the given function.

Trait Implementations

impl Debug for ThemeNameProvider[src]

impl<'_> From<&'_ str> for ThemeNameProvider[src]

impl<F, S, E> From<F> for ThemeNameProvider where
    F: Fn() -> Result<S, E> + Send + Sync + 'static,
    S: Into<String>,
    E: StdError + Send + Sync + 'static, 
[src]

impl From<String> for ThemeNameProvider[src]

impl PartialEq<ThemeNameProvider> for ThemeNameProvider[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,