pub enum Error {
BadPixelDataLength {
expected: usize,
was: usize,
},
FileLengthTooLong {
max: usize,
would_be: usize,
},
BufferTooSmall {
required: usize,
was: usize,
},
WidthTooLarge {
max: usize,
was: usize,
},
HeightTooLarge {
max: usize,
was: usize,
},
}Expand description
Possible errors that can be returned by the write_bmp function
Variants§
BadPixelDataLength
Returned if the provided pixel data is not exactly (width * height * 3) bytes in length.
FileLengthTooLong
The BMP format stores the file length in a u32. This error is returned if the provided width & height would produce a file too large to store the length in the BMP header.
BufferTooSmall
Returned if the given buffer is too small to contain the BMP File. You can use buffer_length to determine how large the buffer needs to be.
WidthTooLarge
The BMP file format stores the width in a signed i32. This error is returned if the given width doesn’t fit in the BMP header.
HeightTooLarge
The BMP file format stores the height in a signed i32. This error is returned if the given height doesn’t fit in the BMP header.
Trait Implementations§
impl Copy for Error
impl Eq for Error
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 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