Skip to main content

CameraError

Struct CameraError 

Source
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

Source

pub fn new(kind: CameraErrorKind, message: impl Into<String>) -> Self

Performs the new operation.

Source

pub fn kind(&self) -> CameraErrorKind

Performs the kind operation.

Source

pub fn code(&self) -> &'static str

Performs the code operation.

Source

pub fn recovery_hint(&self) -> RecoveryHint

Performs the recovery_hint operation.

Source

pub fn is_retryable(&self) -> bool

Performs the is_retryable operation.

Source

pub fn backend(&self) -> Option<&BackendId>

Performs the backend operation.

Source

pub fn device(&self) -> Option<&DeviceId>

Performs the device operation.

Source

pub fn stage(&self) -> Option<OperationStage>

Performs the stage operation.

Source

pub fn operation(&self) -> Option<&str>

Performs the operation operation.

Source

pub fn native_code(&self) -> Option<i64>

Performs the native_code operation.

Source

pub fn io_error(&self) -> Option<&Error>

Performs the io_error operation.

Source

pub fn source_error(&self) -> Option<&(dyn StdError + Send + Sync + 'static)>

Performs the source_error operation.

Source

pub fn backend_attempts(&self) -> Option<&[BackendAttempt]>

Performs the backend_attempts operation.

Source

pub fn causes(&self) -> &[Arc<CameraError>]

Performs the causes operation.

Source

pub fn with_backend(self, backend: BackendId) -> Self

Performs the with_backend operation.

Source

pub fn with_device(self, device: DeviceId) -> Self

Performs the with_device operation.

Source

pub fn with_stage(self, stage: OperationStage) -> Self

Performs the with_stage operation.

Source

pub fn with_operation(self, operation: impl Into<String>) -> Self

Performs the with_operation operation.

Source

pub fn with_native_code(self, code: i64) -> Self

Performs the with_native_code operation.

Source

pub fn with_recovery_hint(self, hint: RecoveryHint) -> Self

Performs the with_recovery_hint operation.

Source

pub fn with_source<E>(self, source: E) -> Self
where E: StdError + Send + Sync + 'static,

Performs the with_source operation.

Source

pub fn invalid_argument(field: &'static str, message: String) -> Self

Performs the invalid_argument operation.

Source

pub fn invalid_config(message: String) -> Self

Performs the invalid_config operation.

Source

pub fn backend_not_compiled(backend: BackendId) -> Self

Performs the backend_not_compiled operation.

Source

pub fn unsupported_target(backend: BackendId, target: &'static str) -> Self

Performs the unsupported_target operation.

Source

pub fn backend_option_mismatch( option_backend: BackendId, selected_backend: BackendId, ) -> Self

Performs the backend_option_mismatch operation.

Source

pub fn backend_failure( backend: BackendId, stage: OperationStage, message: String, ) -> Self

Performs the backend_failure operation.

Source

pub fn native( kind: CameraErrorKind, backend: BackendId, stage: OperationStage, operation: String, code: i64, message: String, ) -> Self

Performs the native operation.

Source

pub fn all_backends_failed(attempts: Vec<BackendAttempt>) -> Self

Performs the all_backends_failed operation.

Source

pub fn device_busy(message: String) -> Self

Performs the device_busy operation.

Source

pub fn permission_required(message: String) -> Self

Performs the permission_required operation.

Source

pub fn permission_denied(message: String) -> Self

Performs the permission_denied operation.

Source

pub fn permission_managed_externally(backend: BackendId) -> Self

Performs the permission_managed_externally operation.

Source

pub fn stream_stopped() -> Self

Performs the stream_stopped operation.

Source

pub fn invalid_state(message: String) -> Self

Performs the invalid_state operation.

Source

pub fn ambiguous_device(message: String) -> Self

Performs the ambiguous_device operation.

Source

pub fn disconnected(message: String) -> Self

Performs the disconnected operation.

Source

pub fn control_not_readable(message: String) -> Self

Performs the control_not_readable operation.

Source

pub fn device_not_found(message: String) -> Self

Performs the device_not_found operation.

Source

pub fn device_open_failed(message: String) -> Self

Performs the device_open_failed operation.

Source

pub fn invalid_frame(message: String) -> Self

Performs the invalid_frame operation.

Source

pub fn unsupported_format(message: String) -> Self

Performs the unsupported_format operation.

Source

pub fn stream_error(message: String) -> Self

Performs the stream_error operation.

Source

pub fn timeout(stage: OperationStage) -> Self

Performs the timeout operation.

Source

pub fn buffer_exhausted() -> Self

Performs the buffer_exhausted operation.

Source

pub fn control_not_supported(message: String) -> Self

Performs the control_not_supported operation.

Source

pub fn control_batch(causes: Vec<Arc<CameraError>>) -> Self

Performs the control_batch operation.

Source

pub fn io(stage: OperationStage, source: Error) -> Self

Performs the io operation.

Source

pub fn worker_failure(message: String) -> Self

Performs the worker_failure operation.

Source

pub fn internal(message: String) -> Self

Performs the internal operation.

Trait Implementations§

Source§

impl Clone for CameraError

Source§

fn clone(&self) -> CameraError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CameraError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CameraError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CameraError

Source§

impl Error for CameraError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for CameraError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CameraError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.