Enum Asset
pub enum Asset {
Font(Style),
Supplemental,
}Expand description
A data file behind the symbols: each style’s official variable font, and the pack of Google’s SVGs for the SVG-only symbols.
With the default embed-assets feature every asset is built in. Without
it, nothing is: Icon::to_svg returns [Error::NotLoaded] until the
icon’s Icon::required_asset is supplied with Asset::provide.
Variants§
Font(Style)
The variable font of one style.
Supplemental
Google’s SVGs for the symbols without a variable-font glyph.
Implementations§
§impl Asset
impl Asset
pub fn bytes(self) -> Option<&'static [u8]>
pub fn bytes(self) -> Option<&'static [u8]>
The asset’s bytes, if they are embedded or have been provided.
pub fn is_available(self) -> bool
pub fn is_available(self) -> bool
Whether icons that need this asset can be drawn.
pub fn provide(self, bytes: Vec<u8>) -> Result<(), Error>
pub fn provide(self, bytes: Vec<u8>) -> Result<(), Error>
Supply the asset’s file, exactly as in this crate’s assets/
directory. Fonts must parse with all four variation axes, and every
file must have its recorded length; this guards against the wrong
file, not tampering, so load assets from a source you trust. The bytes are kept for the rest of
the program. Providing an asset that is already available is a no-op.
Trait Implementations§
impl Copy for Asset
impl Eq for Asset
impl StructuralPartialEq for Asset
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnsafeUnpin for Asset
impl UnwindSafe for Asset
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more