#[non_exhaustive]pub enum PixelsError {
Io {
context: &'static str,
source: Error,
},
Malformed {
format: &'static str,
detail: String,
},
Unsupported {
detail: String,
},
LimitExceeded {
limit: Limit,
requested: u64,
allowed: u64,
},
InvalidArgument {
parameter: &'static str,
detail: String,
},
Graph {
detail: String,
},
}Expand description
The error type returned by every fallible engine operation.
Construct these with the associated helpers (PixelsError::malformed,
PixelsError::unsupported, …) rather than the variants directly, so that
added fields stay non-breaking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
A source read or sink write failed.
Fields
Malformed
Input bytes are invalid for their format.
Every codec parser returns this instead of panicking, for any input.
Fields
Unsupported
A recognized format or feature that is not implemented.
LimitExceeded
A safety limit was exceeded before any pixel allocation.
Fields
InvalidArgument
A caller-supplied argument is invalid.
Fields
Graph
The op graph cannot be evaluated as constructed.
Implementations§
Source§impl PixelsError
impl PixelsError
Sourcepub fn io(context: &'static str, source: Error) -> PixelsError
pub fn io(context: &'static str, source: Error) -> PixelsError
Wrap an I/O error with the engine context it happened in.
Sourcepub fn malformed(format: &'static str, detail: impl Into<String>) -> PixelsError
pub fn malformed(format: &'static str, detail: impl Into<String>) -> PixelsError
Report input bytes that are invalid for format.
Sourcepub fn unsupported(detail: impl Into<String>) -> PixelsError
pub fn unsupported(detail: impl Into<String>) -> PixelsError
Report a recognized but unimplemented format or feature.
Sourcepub fn invalid_argument(
parameter: &'static str,
detail: impl Into<String>,
) -> PixelsError
pub fn invalid_argument( parameter: &'static str, detail: impl Into<String>, ) -> PixelsError
Report an invalid caller-supplied argument.
Sourcepub fn graph(detail: impl Into<String>) -> PixelsError
pub fn graph(detail: impl Into<String>) -> PixelsError
Report a graph that cannot be evaluated.
Sourcepub const fn limit_exceeded(
limit: Limit,
requested: u64,
allowed: u64,
) -> PixelsError
pub const fn limit_exceeded( limit: Limit, requested: u64, allowed: u64, ) -> PixelsError
Report an exceeded safety limit.
Trait Implementations§
Source§impl Debug for PixelsError
impl Debug for PixelsError
Source§impl Display for PixelsError
impl Display for PixelsError
Source§impl Error for PixelsError
impl Error for PixelsError
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()