pub enum CodecError {
Show 13 variants
InsufficientCapacity {
image: (usize, usize),
tensor: (usize, usize),
},
UnsupportedDtype(DType),
UnsupportedFormat(PixelFormat),
Unsupported(UnsupportedFeature),
InvalidData(String),
Io(Error),
Tensor(Error),
NoDevice(String),
InvalidConfig(String),
InvalidInput(String),
Device {
op: String,
source: Error,
},
Timeout(String),
PoolExhausted {
held: usize,
pool: usize,
},
}Expand description
Errors from image decoding and video encoding and decoding.
Variants§
InsufficientCapacity
Image dimensions exceed the tensor’s capacity.
Fields
UnsupportedDtype(DType)
The tensor’s element type is not supported for image decoding.
UnsupportedFormat(PixelFormat)
The requested pixel format is not supported for this image type.
Unsupported(UnsupportedFeature)
The image data is well-formed but uses a feature this decoder does
not implement. Callers can pattern-match on the carried
UnsupportedFeature to react programmatically (e.g. transcode
before retry, surface a precise message, or skip gracefully).
InvalidData(String)
The image data is corrupted, truncated, or not a recognized format.
Io(Error)
I/O error reading image data.
Tensor(Error)
An error from the tensor subsystem.
NoDevice(String)
No device can do what was asked, for example no hardware video encoder.
InvalidConfig(String)
A configuration the codec or the device rejects.
InvalidInput(String)
A source frame that does not match the configuration.
Device
A device operation failed.
Timeout(String)
The device did not finish an operation in time.
PoolExhausted
A video decoder has nowhere to decode to: the caller holds the frames in its output buffers. Dropping decoded frames gives their buffers back; a larger pool lets the caller hold more at once.
Implementations§
Source§impl CodecError
impl CodecError
Sourcepub fn cpu_access_denied(&self) -> Option<&Error>
pub fn cpu_access_denied(&self) -> Option<&Error>
The CpuAccessDenied
refusal this error carries, if any.
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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<Error> for CodecError
impl From<Error> for CodecError
Source§impl From<Error> for CodecError
impl From<Error> for CodecError
Source§impl From<PngDecodeErrors> for CodecError
Available on crate feature png only.
impl From<PngDecodeErrors> for CodecError
png only.