#[non_exhaustive]pub enum Error {
Backend {
message: String,
},
Font {
path: String,
message: String,
},
Image {
path: String,
message: String,
},
Texture {
message: String,
},
UnknownWidget {
id: WidgetId,
},
FormFile {
path: String,
message: String,
},
}Expand description
A failure reported by Pushrod or a backend.
Every variant carries text, not a library-specific error type, so the value is Clone and
Eq and can travel in an EngineEvent.
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.
Backend
A backend could not start or lost a resource it needs (window, renderer, text library).
Font
A font file could not be loaded or used.
Image
An image could not be read, decoded or written.
Texture
A texture could not be created, updated or drawn.
UnknownWidget
A Widget ID does not exist in the widget tree.
FormFile
A form file could not be read or is not valid.
Implementations§
Source§impl Error
impl Error
Sourcepub fn font(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn font(path: impl Into<String>, message: impl Into<String>) -> Self
Creates a Error::Font.
§Arguments
path- The font file’s path.message- What went wrong.
§Returns
The error.
Sourcepub fn image(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn image(path: impl Into<String>, message: impl Into<String>) -> Self
Creates a Error::Image.
§Arguments
path- The image file’s path.message- What went wrong.
§Returns
The error.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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