1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use crate::types::{ApiBackend, FrameFormat};
use thiserror::Error;
#[allow(clippy::module_name_repetitions)]
#[derive(Error, Debug, Clone)]
pub enum NokhwaError {
#[error("Unitialized Camera. Call `init()` first!")]
UnitializedError,
#[error("Could not initialize {backend}: {error}")]
InitializeError { backend: ApiBackend, error: String },
#[error("Could not shutdown {backend}: {error}")]
ShutdownError { backend: ApiBackend, error: String },
#[error("Error: {0}")]
GeneralError(String),
#[error("Could not generate required structure {structure}: {error}")]
StructureError { structure: String, error: String },
#[error("Could not open device {0}: {1}")]
OpenDeviceError(String, String),
#[error("Could not get device property {property}: {error}")]
GetPropertyError { property: String, error: String },
#[error("Could not set device property {property} with value {value}: {error}")]
SetPropertyError {
property: String,
value: String,
error: String,
},
#[error("Could not open device stream: {0}")]
OpenStreamError(String),
#[error("Could not capture frame: {0}")]
ReadFrameError(String),
#[error("Could not process frame {src} to {destination}: {error}")]
ProcessFrameError {
src: FrameFormat,
destination: String,
error: String,
},
#[error("Could not stop stream: {0}")]
StreamShutdownError(String),
#[error("This operation is not supported by backend {0}.")]
UnsupportedOperationError(ApiBackend),
#[error("This operation is not implemented yet: {0}")]
NotImplementedError(String),
}