#[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
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.
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
Returns a duplicate of the value. Read more
1.0.0 · 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 BufferError
impl Debug for BufferError
Source§impl Display for BufferError
impl Display 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)>
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 BufferError
impl PartialEq for BufferError
impl Copy for BufferError
impl Eq for BufferError
impl StructuralPartialEq for BufferError
Auto Trait Implementations§
impl Freeze for BufferError
impl RefUnwindSafe for BufferError
impl Send for BufferError
impl Sync for BufferError
impl Unpin for BufferError
impl UnsafeUnpin for BufferError
impl UnwindSafe for BufferError
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