#[non_exhaustive]pub enum Error {
PermissionDenied,
DeviceNotFound(String),
DeviceInUse,
FormatNotSupported,
Timeout,
StreamEnded,
MjpegDecode(String),
BackendNotImplemented {
platform: &'static str,
},
Backend {
platform: &'static str,
message: String,
},
Unsupported {
platform: &'static str,
reason: &'static str,
},
InvalidSubnet(String),
}Expand description
Every error returned by cameras.
Matches on shape, not string text. Each variant carries the context needed to diagnose the failure without having to parse a message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PermissionDenied
The user or OS denied access to camera hardware.
DeviceNotFound(String)
The supplied crate::DeviceId did not match any currently-connected device.
DeviceInUse
Another application holds exclusive access to the camera.
FormatNotSupported
The requested crate::StreamConfig is not supported by the device.
Timeout
crate::next_frame did not receive a frame before the timeout expired.
StreamEnded
The camera stream ended (for example, the device was unplugged).
MjpegDecode(String)
MJPEG decoding via zune-jpeg failed.
BackendNotImplemented
The current platform does not yet have a backend implementation.
Backend
Catch-all for platform-specific failures (ObjC exceptions, HRESULTs, ioctl errors).
Fields
Unsupported
The requested control or capability is not supported on this platform/device.
Fields
InvalidSubnet(String)
A CIDR subnet passed to discovery was rejected (unparsable, IPv6, or exceeds the host cap).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()