#[non_exhaustive]pub enum CameraError {
Camera(CameraError),
Jni(Error),
Adapter {
kind: CameraErrorKind,
recovery_hint: RecoveryHint,
message: String,
},
Io(Error),
}Expand description
Android/JNI adapter error that preserves the core camera error contract.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Camera(CameraError)
Error propagated by the platform-independent camera crate.
Jni(Error)
Failure while interacting with the JVM through JNI.
Adapter
Failure produced by Android adapter validation or state management.
Fields
kind: CameraErrorKindStable machine-readable error category.
recovery_hint: RecoveryHintRecommended recovery action for the caller.
Io(Error)
Operating-system I/O failure while handling device descriptors.
Implementations§
Source§impl CameraError
impl CameraError
Sourcepub fn adapter(kind: CameraErrorKind, message: impl Into<String>) -> Self
pub fn adapter(kind: CameraErrorKind, message: impl Into<String>) -> Self
Creates an Android adapter error with no automatic recovery action.
Sourcepub fn kind(&self) -> CameraErrorKind
pub fn kind(&self) -> CameraErrorKind
Returns the stable machine-readable error category.
Sourcepub fn recovery_hint(&self) -> RecoveryHint
pub fn recovery_hint(&self) -> RecoveryHint
Returns the recovery action recommended to the caller.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns whether retrying is a meaningful recovery action.
Sourcepub fn backend(&self) -> Option<&BackendId>
pub fn backend(&self) -> Option<&BackendId>
Returns the backend associated with a core camera error, if known.
Sourcepub fn stage(&self) -> Option<OperationStage>
pub fn stage(&self) -> Option<OperationStage>
Returns the operation stage at which the failure occurred, if known.
Sourcepub fn native_code(&self) -> Option<i64>
pub fn native_code(&self) -> Option<i64>
Returns the native platform error code, if one is available.
Sourcepub fn boundary_payload(&self) -> String
pub fn boundary_payload(&self) -> String
JSON carried by the JNI exception message. Kotlin/Flutter callers can
branch on code and recovery without parsing localized prose.
Trait Implementations§
Source§impl Debug for CameraError
impl Debug for CameraError
Source§impl Display for CameraError
impl Display for CameraError
Source§impl Error for CameraError
impl Error for CameraError
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()