pub struct LookupBuilder<'a> { /* private fields */ }
Expand description
The lookup builder struct, holding all the lookup query parameters.
Implementations§
source§impl<'a> LookupBuilder<'a>
impl<'a> LookupBuilder<'a>
sourcepub fn with_size(self, size: u16) -> Self
pub fn with_size(self, size: u16) -> Self
Restrict the lookup to the given icon size.
§Example
use freedesktop_icons::lookup;
let icon = lookup("firefox")
.with_size(48)
.find();
sourcepub fn with_scale(self, scale: u16) -> Self
pub fn with_scale(self, scale: u16) -> Self
Restrict the lookup to the given scale.
§Example
use freedesktop_icons::lookup;
let icon = lookup("firefox")
.with_scale(2)
.find();
sourcepub fn with_theme<'b: 'a>(self, theme: &'b str) -> Self
pub fn with_theme<'b: 'a>(self, theme: &'b str) -> Self
Add the given theme to the current lookup :
§Example
use freedesktop_icons::lookup;
let icon = lookup("firefox")
.with_theme("Papirus")
.find();
sourcepub fn with_cache(self) -> Self
pub fn with_cache(self) -> Self
Store the result of the lookup in cache, subsequent lookup will first try to get the cached icon. This can drastically increase lookup performances for application that repeat the same lookups, an application launcher for instance.
§Example
use freedesktop_icons::lookup;
let icon = lookup("firefox")
.with_scale(2)
.with_cache()
.find();
sourcepub fn force_svg(self) -> Self
pub fn force_svg(self) -> Self
By default [find
] will prioritize Png over Svg icon.
Use this if you need to prioritize Svg icons. This could be useful
if you need a modifiable icon, to match a user theme for instance.
§Example
use freedesktop_icons::lookup;
let icon = lookup("firefox")
.force_svg()
.find();
Auto Trait Implementations§
impl<'a> Freeze for LookupBuilder<'a>
impl<'a> RefUnwindSafe for LookupBuilder<'a>
impl<'a> Send for LookupBuilder<'a>
impl<'a> Sync for LookupBuilder<'a>
impl<'a> Unpin for LookupBuilder<'a>
impl<'a> UnwindSafe for LookupBuilder<'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