#[non_exhaustive]pub enum TextToPngError {
InvalidColor,
InvalidFontSize,
NoFontFound,
InvalidInput,
CouldNotCreateImageStorage,
TextProcessError(Error),
PngGeneratorError(EncodingError),
}
Expand description
Error type returned on unsuccessful rendering calls
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidColor
Error case when the color string given is not parsable into a valid color
InvalidFontSize
Error indicating the given font size was invalid
NoFontFound
Error indicating the font data given did not contain a valid font
InvalidInput
Indicates an error with the inputs, but we can’t pin down what it was
CouldNotCreateImageStorage
Error indicating the memory for the rendered text couldn’t be allocated. Note. This won’t happen until memory allocation is fallible ala https://github.com/rust-lang/rust/issues/48043
TextProcessError(Error)
Error case to handle failures form usvg
PngGeneratorError(EncodingError)
Error case to handle failures from resvg and tiny-skia
Trait Implementations§
Source§impl Debug for TextToPngError
impl Debug for TextToPngError
Source§impl Display for TextToPngError
impl Display for TextToPngError
Source§impl Error for TextToPngError
impl Error for TextToPngError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<EncodingError> for TextToPngError
impl From<EncodingError> for TextToPngError
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TextToPngError
impl !RefUnwindSafe for TextToPngError
impl Send for TextToPngError
impl Sync for TextToPngError
impl Unpin for TextToPngError
impl !UnwindSafe for TextToPngError
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