#[non_exhaustive]pub enum BufferError {
AlignmentViolation,
InsufficientData,
StrideTooSmall,
StrideNotPixelAligned,
InvalidDimensions,
IncompatibleDescriptor,
AllocationFailed,
}Expand description
Errors from pixel buffer operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlignmentViolation
Data pointer is not aligned for the channel type.
InsufficientData
Data slice is too small for the given dimensions and stride.
StrideTooSmall
Stride is smaller than width * bytes_per_pixel.
StrideNotPixelAligned
Stride is not a multiple of bytes_per_pixel.
Every row must start on a pixel boundary. If stride is not a multiple of bpp, rows after the first will be misaligned.
InvalidDimensions
Width or height is zero or causes overflow.
IncompatibleDescriptor
Descriptor bytes_per_pixel mismatch in reinterpret().
The new descriptor has a different bytes_per_pixel() than the
current one, so reinterpreting the buffer would be invalid.
AllocationFailed
Buffer allocation failed (out of memory or overflow).
Trait Implementations§
Source§impl Clone for BufferError
impl Clone for BufferError
Source§fn clone(&self) -> BufferError
fn clone(&self) -> BufferError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BufferError
Source§impl Debug for BufferError
impl Debug for BufferError
Source§impl Display for BufferError
impl Display for BufferError
impl Eq for BufferError
Source§impl Error for BufferError
impl Error for BufferError
1.30.0 · 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<BufferError> for ConvertError
impl From<BufferError> for ConvertError
Source§fn from(err: BufferError) -> Self
fn from(err: BufferError) -> Self
Wrap a buffer-construction failure’s real cause into
ConvertError::Buffer. Pair with map_err_at at the call sites so the
At location trace is preserved alongside the classified cause.
Source§impl PartialEq for BufferError
impl PartialEq for BufferError
Source§fn eq(&self, other: &BufferError) -> bool
fn eq(&self, other: &BufferError) -> bool
self and other values to be equal, and is used by ==.