pub struct Error { /* private fields */ }Expand description
Errors that can occur during JPEG encoding/decoding.
Use Error::kind() to match on the specific error variant.
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(kind: ErrorKind) -> Self
pub fn new(kind: ErrorKind) -> Self
Create a new error with the given kind, capturing the current location.
Sourcepub const fn new_untraced(kind: ErrorKind) -> Self
pub const fn new_untraced(kind: ErrorKind) -> Self
Create a new error without capturing a trace (for hot paths).
Sourcepub fn invalid_dimensions(width: u32, height: u32, reason: &'static str) -> Self
pub fn invalid_dimensions(width: u32, height: u32, reason: &'static str) -> Self
Create an invalid dimensions error.
Sourcepub fn invalid_color_format(reason: &'static str) -> Self
pub fn invalid_color_format(reason: &'static str) -> Self
Create an invalid color format error.
Sourcepub fn invalid_buffer_size(expected: usize, actual: usize) -> Self
pub fn invalid_buffer_size(expected: usize, actual: usize) -> Self
Create an invalid buffer size error.
Sourcepub fn unsupported_feature(feature: &'static str) -> Self
pub fn unsupported_feature(feature: &'static str) -> Self
Create an unsupported feature error.
Sourcepub fn unsupported_pixel_format(format: PixelFormat) -> Self
pub fn unsupported_pixel_format(format: PixelFormat) -> Self
Create an unsupported pixel format error.
Sourcepub fn allocation_failed(bytes: usize, context: &'static str) -> Self
pub fn allocation_failed(bytes: usize, context: &'static str) -> Self
Create an allocation failed error.
Sourcepub fn size_overflow(context: &'static str) -> Self
pub fn size_overflow(context: &'static str) -> Self
Create a size overflow error.
Sourcepub fn image_too_large(pixels: u64, limit: u64) -> Self
pub fn image_too_large(pixels: u64, limit: u64) -> Self
Create an image too large error.
Sourcepub fn invalid_jpeg_data(reason: &'static str) -> Self
pub fn invalid_jpeg_data(reason: &'static str) -> Self
Create an invalid JPEG data error.
Sourcepub fn truncated_data(context: &'static str) -> Self
pub fn truncated_data(context: &'static str) -> Self
Create a truncated data error.
Sourcepub fn invalid_marker(marker: u8, context: &'static str) -> Self
pub fn invalid_marker(marker: u8, context: &'static str) -> Self
Create an invalid marker error.
Sourcepub fn invalid_huffman_table(table_idx: u8, reason: &'static str) -> Self
pub fn invalid_huffman_table(table_idx: u8, reason: &'static str) -> Self
Create an invalid Huffman table error.
Sourcepub fn invalid_quant_table(table_idx: u8, reason: &'static str) -> Self
pub fn invalid_quant_table(table_idx: u8, reason: &'static str) -> Self
Create an invalid quantization table error.
Sourcepub fn too_many_scans(count: usize, limit: usize) -> Self
pub fn too_many_scans(count: usize, limit: usize) -> Self
Create a too many scans error.
Sourcepub fn decode_error(reason: String) -> Self
pub fn decode_error(reason: String) -> Self
Create a decode error.
Sourcepub fn invalid_quality(value: f32, valid_range: &'static str) -> Self
pub fn invalid_quality(value: f32, valid_range: &'static str) -> Self
Create an invalid quality error.
Sourcepub fn invalid_scan_script(reason: String) -> Self
pub fn invalid_scan_script(reason: String) -> Self
Create an invalid scan script error.
Sourcepub fn invalid_config(reason: String) -> Self
pub fn invalid_config(reason: String) -> Self
Create an invalid config error.
Sourcepub fn stride_too_small(width: u32, stride: usize) -> Self
pub fn stride_too_small(width: u32, stride: usize) -> Self
Create a stride too small error.
Sourcepub fn too_many_rows(height: u32, pushed: u32) -> Self
pub fn too_many_rows(height: u32, pushed: u32) -> Self
Create a too many rows error.
Sourcepub fn incomplete_image(height: u32, pushed: u32) -> Self
pub fn incomplete_image(height: u32, pushed: u32) -> Self
Create an incomplete image error.
Trait Implementations§
Source§impl AtTraceable for Error
impl AtTraceable for Error
Source§fn trace(&self) -> Option<&AtTrace>
fn trace(&self) -> Option<&AtTrace>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn at_str(self, msg: &'static str) -> Self
fn at_str(self, msg: &'static str) -> Self
Source§fn at_string(self, f: impl FnOnce() -> String) -> Self
fn at_string(self, f: impl FnOnce() -> String) -> Self
Source§fn at_data<T>(self, f: impl FnOnce() -> T) -> Self
fn at_data<T>(self, f: impl FnOnce() -> T) -> Self
Source§fn at_debug<T>(self, f: impl FnOnce() -> T) -> Self
fn at_debug<T>(self, f: impl FnOnce() -> T) -> Self
Source§fn at_error<E>(self, err: E) -> Self
fn at_error<E>(self, err: E) -> Self
Source§fn at_crate(self, info: &'static AtCrateInfo) -> Self
fn at_crate(self, info: &'static AtCrateInfo) -> Self
Source§fn at_fn<F>(self, _marker: F) -> Selfwhere
F: Fn(),
fn at_fn<F>(self, _marker: F) -> Selfwhere
F: Fn(),
Source§fn at_named(self, name: &'static str) -> Self
fn at_named(self, name: &'static str) -> Self
Source§fn at_pop(&mut self) -> Option<AtFrameOwned>
fn at_pop(&mut self) -> Option<AtFrameOwned>
Source§fn at_push(&mut self, segment: AtFrameOwned)
fn at_push(&mut self, segment: AtFrameOwned)
Source§fn at_first_pop(&mut self) -> Option<AtFrameOwned>
fn at_first_pop(&mut self) -> Option<AtFrameOwned>
Source§fn at_first_insert(&mut self, segment: AtFrameOwned)
fn at_first_insert(&mut self, segment: AtFrameOwned)
Source§fn map_traceable<E2, F>(self, f: F) -> E2where
F: FnOnce(Self) -> E2,
E2: AtTraceable,
fn map_traceable<E2, F>(self, f: F) -> E2where
F: FnOnce(Self) -> E2,
E2: AtTraceable,
AtTraceable type, transferring the trace. Read moreSource§fn into_at<E2, F>(self, f: F) -> At<E2>where
F: FnOnce(Self) -> E2,
fn into_at<E2, F>(self, f: F) -> At<E2>where
F: FnOnce(Self) -> E2,
At<E2>, transferring the trace.Source§fn full_trace(&self) -> impl Display
fn full_trace(&self) -> impl Display
Source§fn last_error_trace(&self) -> impl Display
fn last_error_trace(&self) -> impl Display
Source§fn last_error(&self) -> impl Display
fn last_error(&self) -> impl Display
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.