Implement write support for clipboard_x11

This commit is contained in:
Héctor Ramón Jiménez 2021-03-06 04:34:02 +01:00
parent aeda90d4ef
commit a97dfae8f6
11 changed files with 496 additions and 185 deletions

View file

@ -1,6 +1,8 @@
use x11rb::errors::{ConnectError, ConnectionError, ReplyError};
use x11rb::protocol::xproto::Atom;
use std::sync::mpsc;
#[must_use]
#[derive(Debug, thiserror::Error)]
pub enum Error {
@ -14,4 +16,12 @@ pub enum Error {
Timeout,
#[error("unexpected type: {0}")]
UnexpectedType(Atom),
#[error("invalid utf8 string: {0}")]
InvalidUtf8(std::string::FromUtf8Error),
#[error("deadlock")]
SelectionLocked,
#[error("invalid selection owner")]
InvalidOwner,
#[error("worker communication error")]
SendError(#[from] mpsc::SendError<Atom>),
}