pub struct CameraError { /* private fields */ }Expand description
One public error type returned by every camera operation.
The representation is a struct so new diagnostics do not force downstream
users to update exhaustive enum matches. Branch on Self::kind instead.
Implementations§
Source§impl CameraError
impl CameraError
Sourcepub fn new(kind: CameraErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: CameraErrorKind, message: impl Into<String>) -> Self
Performs the new operation.
Sourcepub fn kind(&self) -> CameraErrorKind
pub fn kind(&self) -> CameraErrorKind
Performs the kind operation.
Sourcepub fn recovery_hint(&self) -> RecoveryHint
pub fn recovery_hint(&self) -> RecoveryHint
Performs the recovery_hint operation.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Performs the is_retryable operation.
Sourcepub fn stage(&self) -> Option<OperationStage>
pub fn stage(&self) -> Option<OperationStage>
Performs the stage operation.
Sourcepub fn native_code(&self) -> Option<i64>
pub fn native_code(&self) -> Option<i64>
Performs the native_code operation.
Sourcepub fn source_error(&self) -> Option<&(dyn StdError + Send + Sync + 'static)>
pub fn source_error(&self) -> Option<&(dyn StdError + Send + Sync + 'static)>
Performs the source_error operation.
Sourcepub fn backend_attempts(&self) -> Option<&[BackendAttempt]>
pub fn backend_attempts(&self) -> Option<&[BackendAttempt]>
Performs the backend_attempts operation.
Sourcepub fn causes(&self) -> &[Arc<CameraError>]
pub fn causes(&self) -> &[Arc<CameraError>]
Performs the causes operation.
Sourcepub fn with_backend(self, backend: BackendId) -> Self
pub fn with_backend(self, backend: BackendId) -> Self
Performs the with_backend operation.
Sourcepub fn with_device(self, device: DeviceId) -> Self
pub fn with_device(self, device: DeviceId) -> Self
Performs the with_device operation.
Sourcepub fn with_stage(self, stage: OperationStage) -> Self
pub fn with_stage(self, stage: OperationStage) -> Self
Performs the with_stage operation.
Sourcepub fn with_operation(self, operation: impl Into<String>) -> Self
pub fn with_operation(self, operation: impl Into<String>) -> Self
Performs the with_operation operation.
Sourcepub fn with_native_code(self, code: i64) -> Self
pub fn with_native_code(self, code: i64) -> Self
Performs the with_native_code operation.
Sourcepub fn with_recovery_hint(self, hint: RecoveryHint) -> Self
pub fn with_recovery_hint(self, hint: RecoveryHint) -> Self
Performs the with_recovery_hint operation.
Sourcepub fn with_source<E>(self, source: E) -> Self
pub fn with_source<E>(self, source: E) -> Self
Performs the with_source operation.
Sourcepub fn invalid_argument(field: &'static str, message: String) -> Self
pub fn invalid_argument(field: &'static str, message: String) -> Self
Performs the invalid_argument operation.
Sourcepub fn invalid_config(message: String) -> Self
pub fn invalid_config(message: String) -> Self
Performs the invalid_config operation.
Sourcepub fn backend_not_compiled(backend: BackendId) -> Self
pub fn backend_not_compiled(backend: BackendId) -> Self
Performs the backend_not_compiled operation.
Sourcepub fn unsupported_target(backend: BackendId, target: &'static str) -> Self
pub fn unsupported_target(backend: BackendId, target: &'static str) -> Self
Performs the unsupported_target operation.
Sourcepub fn backend_option_mismatch(
option_backend: BackendId,
selected_backend: BackendId,
) -> Self
pub fn backend_option_mismatch( option_backend: BackendId, selected_backend: BackendId, ) -> Self
Performs the backend_option_mismatch operation.
Sourcepub fn backend_failure(
backend: BackendId,
stage: OperationStage,
message: String,
) -> Self
pub fn backend_failure( backend: BackendId, stage: OperationStage, message: String, ) -> Self
Performs the backend_failure operation.
Sourcepub fn native(
kind: CameraErrorKind,
backend: BackendId,
stage: OperationStage,
operation: String,
code: i64,
message: String,
) -> Self
pub fn native( kind: CameraErrorKind, backend: BackendId, stage: OperationStage, operation: String, code: i64, message: String, ) -> Self
Performs the native operation.
Sourcepub fn all_backends_failed(attempts: Vec<BackendAttempt>) -> Self
pub fn all_backends_failed(attempts: Vec<BackendAttempt>) -> Self
Performs the all_backends_failed operation.
Sourcepub fn device_busy(message: String) -> Self
pub fn device_busy(message: String) -> Self
Performs the device_busy operation.
Sourcepub fn permission_required(message: String) -> Self
pub fn permission_required(message: String) -> Self
Performs the permission_required operation.
Sourcepub fn permission_denied(message: String) -> Self
pub fn permission_denied(message: String) -> Self
Performs the permission_denied operation.
Sourcepub fn permission_managed_externally(backend: BackendId) -> Self
pub fn permission_managed_externally(backend: BackendId) -> Self
Performs the permission_managed_externally operation.
Sourcepub fn stream_stopped() -> Self
pub fn stream_stopped() -> Self
Performs the stream_stopped operation.
Sourcepub fn invalid_state(message: String) -> Self
pub fn invalid_state(message: String) -> Self
Performs the invalid_state operation.
Sourcepub fn ambiguous_device(message: String) -> Self
pub fn ambiguous_device(message: String) -> Self
Performs the ambiguous_device operation.
Sourcepub fn disconnected(message: String) -> Self
pub fn disconnected(message: String) -> Self
Performs the disconnected operation.
Sourcepub fn control_not_readable(message: String) -> Self
pub fn control_not_readable(message: String) -> Self
Performs the control_not_readable operation.
Sourcepub fn device_not_found(message: String) -> Self
pub fn device_not_found(message: String) -> Self
Performs the device_not_found operation.
Sourcepub fn device_open_failed(message: String) -> Self
pub fn device_open_failed(message: String) -> Self
Performs the device_open_failed operation.
Sourcepub fn invalid_frame(message: String) -> Self
pub fn invalid_frame(message: String) -> Self
Performs the invalid_frame operation.
Sourcepub fn unsupported_format(message: String) -> Self
pub fn unsupported_format(message: String) -> Self
Performs the unsupported_format operation.
Sourcepub fn stream_error(message: String) -> Self
pub fn stream_error(message: String) -> Self
Performs the stream_error operation.
Sourcepub fn timeout(stage: OperationStage) -> Self
pub fn timeout(stage: OperationStage) -> Self
Performs the timeout operation.
Sourcepub fn buffer_exhausted() -> Self
pub fn buffer_exhausted() -> Self
Performs the buffer_exhausted operation.
Sourcepub fn control_not_supported(message: String) -> Self
pub fn control_not_supported(message: String) -> Self
Performs the control_not_supported operation.
Sourcepub fn control_batch(causes: Vec<Arc<CameraError>>) -> Self
pub fn control_batch(causes: Vec<Arc<CameraError>>) -> Self
Performs the control_batch operation.
Sourcepub fn io(stage: OperationStage, source: Error) -> Self
pub fn io(stage: OperationStage, source: Error) -> Self
Performs the io operation.
Sourcepub fn worker_failure(message: String) -> Self
pub fn worker_failure(message: String) -> Self
Performs the worker_failure operation.
Trait Implementations§
Source§impl Clone for CameraError
impl Clone for CameraError
Source§impl Debug for CameraError
impl Debug for CameraError
Source§impl Display for CameraError
impl Display for CameraError
impl Eq 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()