#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("cannot connect to the Wayland compositor: {0}")]
Connect(String),
#[error("the compositor offers neither ext-data-control-v1 nor wlr-data-control-unstable-v1")]
Unsupported,
#[error("the requested data-control protocol is not offered by the compositor")]
ProtocolUnavailable,
#[error("the compositor advertises no seat")]
NoSeat,
#[error("Wayland error: {0}")]
Wayland(String),
#[error("the clipboard worker has stopped")]
Stopped,
#[error("clipboard data of {size} bytes exceeds the {limit} byte limit")]
TooLarge {
size: usize,
limit: usize,
},
#[error("the clipboard source did not deliver its data in time")]
Timeout,
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
}
pub type Result<T> = std::result::Result<T, Error>;