1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Error, Debug)]
10#[non_exhaustive]
11pub enum Error {
12 #[error("memory pool exhausted: no slots available")]
14 PoolExhausted,
15
16 #[error("buffer pool error: {0}")]
18 BufferPool(String),
19
20 #[error("memory allocation failed: {0}")]
22 AllocationFailed(String),
23
24 #[error("invalid memory segment: {0}")]
26 InvalidSegment(String),
27
28 #[error("buffer validation failed: {0}")]
30 ValidationFailed(String),
31
32 #[error("invalid caps: {0}")]
34 InvalidCaps(String),
35
36 #[error("configuration error: {0}")]
38 Config(String),
39
40 #[error("pipeline error: {0}")]
42 Pipeline(String),
43
44 #[error("element error: {0}")]
46 Element(String),
47
48 #[error("I/O error: {0}")]
50 Io(#[from] std::io::Error),
51
52 #[error("system error: {0}")]
54 System(#[from] rustix::io::Errno),
55
56 #[cfg(any(
58 feature = "pipewire",
59 feature = "libcamera",
60 feature = "screen-capture",
61 feature = "v4l2",
62 feature = "alsa"
63 ))]
64 #[error("device error: {0}")]
65 Device(#[from] crate::elements::device::DeviceError),
66}