#[non_exhaustive]pub enum CodesError {
Destination {
actual: PixelFormat,
},
RangeMismatch {
source: SignalRange,
destination: SignalRange,
},
ComponentCount {
expected: usize,
actual: usize,
},
Narrowing {
component: usize,
bits: u8,
destination_bits: u8,
},
Map {
component: usize,
error: CodeMapError,
},
Extent {
component: usize,
origin: (usize, usize),
extent: (usize, usize),
plane: (usize, usize),
},
Read(CodePlaneError),
}Expand description
Native components cannot be widened into the requested canonical image.
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.
Destination
The destination is not canonical full-packing U8/U16 Gray, GrayAlpha, RGB, or RGBA.
Fields
§
actual: PixelFormatThe destination spec.
RangeMismatch
The destination’s signal range differs from the components’ range.
Fields
§
source: SignalRangeRange of the native components.
§
destination: SignalRangeRange declared by the destination.
ComponentCount
The number of components differs from the destination’s channels.
Narrowing
A component has more code bits than the destination; widening only.
Fields
Map
A component’s encoding has no exact rule for its role and range.
Extent
The requested region extends beyond a component plane.
Fields
Read(CodePlaneError)
A plane read failed after validation; an internal consistency error.
Trait Implementations§
Source§impl Clone for CodesError
impl Clone for CodesError
Source§fn clone(&self) -> CodesError
fn clone(&self) -> CodesError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodesError
impl Debug for CodesError
Source§impl Display for CodesError
impl Display for CodesError
impl Eq for CodesError
Source§impl Error for CodesError
impl Error for CodesError
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()
Source§impl PartialEq for CodesError
impl PartialEq for CodesError
impl StructuralPartialEq for CodesError
Auto Trait Implementations§
impl Freeze for CodesError
impl RefUnwindSafe for CodesError
impl Send for CodesError
impl Sync for CodesError
impl Unpin for CodesError
impl UnsafeUnpin for CodesError
impl UnwindSafe for CodesError
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