Struct SymbolIcon
pub struct SymbolIcon { /* private fields */ }Expand description
A symbol, visual style, and validated set of variation coordinates.
Implementations§
§impl Icon
impl Icon
pub fn component(self) -> Icon
pub fn component(self) -> Icon
A themed Longbridge component icon, respecting Kit sizing and icon resolution.
Register MaterialSymbols before rendering path-based icons.
Path-based icons are not validated here: an SVG-only symbol with axes that
Icon::is_supported rejects loads with an error and renders empty.
Use Self::embedded to surface that error at construction time.
pub fn embedded(self) -> Result<Icon, Error>
pub fn embedded(self) -> Result<Icon, Error>
A component icon with embedded SVG data; no asset source registration needed. Invalid discrete variants fail immediately. Raw data bypasses Kit’s path resolver.
pub fn svg(self) -> Svg
pub fn svg(self) -> Svg
Return the raw SVG primitive from the same backend as GPUI Kit.
Register MaterialSymbols on the application before rendering.
§impl Icon
impl Icon
pub fn filled(self, filled: bool) -> Icon
pub fn filled(self, filled: bool) -> Icon
Select the filled or unfilled state without changing other axes.
pub fn visual_style(self) -> Style
pub fn visual_style(self) -> Style
The selected visual style.
pub fn variations(self) -> Axes
pub fn variations(self) -> Axes
The selected axes.
pub fn asset_path(self) -> String
pub fn asset_path(self) -> String
A deterministic, namespaced asset path including every variation coordinate.
pub fn from_asset_path(path: &str) -> Result<Icon, Error>
pub fn from_asset_path(path: &str) -> Result<Icon, Error>
Decode an asset path. Noncanonical and malformed paths are rejected.
pub fn required_asset(self) -> Asset
pub fn required_asset(self) -> Asset
The asset Icon::to_svg reads: the style’s font, or the SVG pack
for SVG-only symbols.
pub fn is_supported(self) -> bool
pub fn is_supported(self) -> bool
Whether this exact style and axis combination is available upstream.
Trait Implementations§
impl Copy for Icon
Source§impl From<Icon> for Icon
impl From<Icon> for Icon
Source§fn from(icon: SymbolIcon) -> Self
fn from(icon: SymbolIcon) -> Self
impl StructuralPartialEq for Icon
Auto Trait Implementations§
impl Freeze for Icon
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnsafeUnpin for Icon
impl UnwindSafe for Icon
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<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