pub enum IconError {
TooLarge,
InvalidXml(String),
MissingViewBox,
NonSquare(f64, f64),
ExternalResource(String),
DimensionsTooLarge,
InvalidSvg(String),
FullyTransparent,
Allocation(u32),
}Expand description
Application-icon validation and raster allocation failures.
XML/SVG/backend messages and rejected resource strings are included verbatim and can vary with dependency versions. Match variants for control flow.
§Examples
use ailloli_ui_icon::IconError;
assert_eq!(IconError::MissingViewBox.to_string(), "application icon SVG must declare a positive viewBox");Variants§
TooLarge
Source length is strictly greater than MAX_SVG_BYTES.
InvalidXml(String)
Source is not UTF-8, is malformed XML, or its root is not <svg>.
MissingViewBox
View box is absent/malformed, not four numbers, or has nonpositive size.
NonSquare(f64, f64)
Relative view-box width/height delta exceeds square tolerance.
ExternalResource(String)
A forbidden element, reference, or recognized external CSS value was found.
DimensionsTooLarge
Raw view box or parsed tree width/height exceeds 8,192 pixels.
InvalidSvg(String)
[usvg] rejected otherwise structurally prevalidated bytes.
FullyTransparent
A 64-by-64 validation preview contained no pixel with nonzero alpha.
Allocation(u32)
Square RGBA pixmap allocation failed for the normalized side length.