pub enum ImgGenRendererError {
Show 17 variants
SpecError(ImgGenSpecError),
BoundsTooLarge {
shape: &'static str,
},
InvalidPathBounds {
shape: &'static str,
},
PixmapAllocationFailed {
shape: &'static str,
width: u32,
height: u32,
},
RasterBufferConversionFailed {
shape: &'static str,
width: u32,
height: u32,
},
SaveImageFailed {
path: String,
source: ImageError,
},
CollectImageBytesFailed {
source: Error,
},
OpenImageFailed {
path: String,
source: Error,
},
DecodeImageFailed {
path: String,
source: ImageError,
},
ReadSvgFailed {
path: String,
source: Error,
},
ParseSvgFailed {
path: String,
source: Error,
},
ParseSvgXmlFailed {
path: String,
source: Error,
},
SvgScaledToZeroSize {
path: String,
},
ImageNotFound {
name: String,
},
ReadFontFileFailed {
path: String,
source: Error,
},
InvalidGlyphRunFontReference,
FontSourceError(FontSourceError),
}Expand description
Errors produced while rendering images and loading renderer resources.
Variants§
SpecError(ImgGenSpecError)
Wraps a specification validation error.
BoundsTooLarge
Returned when a rendered shape exceeds safe raster bounds.
InvalidPathBounds
Returned when a shape path reports invalid bounds.
PixmapAllocationFailed
Returned when pixmap allocation fails for a rendered shape.
Fields
RasterBufferConversionFailed
Returned when an intermediate raster buffer cannot be converted to RGBA pixels.
Fields
SaveImageFailed
Returned when an image cannot be written to disk.
Fields
source: ImageErrorThe underlying image-encoding error.
CollectImageBytesFailed
Returned when image bytes cannot be collected from the pixel buffer.
OpenImageFailed
Returned when an input image file cannot be opened.
DecodeImageFailed
Returned when an input image file cannot be decoded.
ReadSvgFailed
Returned when an SVG file cannot be read from disk.
ParseSvgFailed
Returned when SVG parsing fails after the file is read.
ParseSvgXmlFailed
Returned when SVG XML parsing fails.
SvgScaledToZeroSize
Returned when an SVG scales down to zero pixels.
ImageNotFound
Returned when a referenced image cannot be located.
ReadFontFileFailed
Returned when a font file cannot be read.
InvalidGlyphRunFontReference
Returned when glyph shaping cannot obtain a font reference.
FontSourceError(FontSourceError)
Wraps an error returned by the fontsource client.
Trait Implementations§
Source§impl Debug for ImgGenRendererError
impl Debug for ImgGenRendererError
Source§impl Display for ImgGenRendererError
impl Display for ImgGenRendererError
Source§impl Error for ImgGenRendererError
impl Error for ImgGenRendererError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<FontSourceError> for ImgGenRendererError
impl From<FontSourceError> for ImgGenRendererError
Source§fn from(source: FontSourceError) -> Self
fn from(source: FontSourceError) -> Self
Source§impl From<ImgGenSpecError> for ImgGenRendererError
impl From<ImgGenSpecError> for ImgGenRendererError
Source§fn from(source: ImgGenSpecError) -> Self
fn from(source: ImgGenSpecError) -> Self
Auto Trait Implementations§
impl Freeze for ImgGenRendererError
impl !RefUnwindSafe for ImgGenRendererError
impl Send for ImgGenRendererError
impl Sync for ImgGenRendererError
impl Unpin for ImgGenRendererError
impl UnsafeUnpin for ImgGenRendererError
impl !UnwindSafe for ImgGenRendererError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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