#[cfg(target_os = "linux")]
pub(crate) mod dlopen;
#[cfg(target_os = "macos")]
pub(crate) mod macos;
pub mod mock;
pub(crate) mod osc52;
pub mod ssh_aware;
#[cfg(target_os = "linux")]
pub(crate) mod wayland;
#[cfg(target_os = "linux")]
pub mod wayland_backend;
#[cfg(target_os = "linux")]
pub(crate) mod wayland_socket;
#[cfg(target_os = "linux")]
pub(crate) mod wayland_thread;
#[cfg(target_os = "linux")]
pub(crate) mod wayland_wire;
#[cfg(target_os = "windows")]
pub(crate) mod windows;
#[cfg(target_os = "linux")]
pub(crate) mod x11;
#[cfg(target_os = "linux")]
pub mod x11_backend;
#[cfg(target_os = "linux")]
pub(crate) mod x11_thread;
use crate::{BackendKind, Capabilities, ClipboardError, MimeType, Selection};
use async_trait::async_trait;
#[async_trait]
pub trait Backend: Send + Sync + 'static {
fn kind(&self) -> BackendKind;
fn capabilities(&self) -> Capabilities;
fn set(&self, sel: Selection, mime: MimeType, bytes: &[u8]) -> Result<(), ClipboardError>;
fn get(&self, sel: Selection, mime: MimeType) -> Result<Vec<u8>, ClipboardError>;
fn clear(&self, sel: Selection) -> Result<(), ClipboardError>;
fn available(&self, sel: Selection) -> Result<Vec<MimeType>, ClipboardError>;
async fn set_async(
&self,
_sel: Selection,
_mime: MimeType,
_bytes: Vec<u8>,
) -> Result<(), ClipboardError> {
Err(ClipboardError::UnsupportedAsync)
}
async fn get_async(&self, _sel: Selection, _mime: MimeType) -> Result<Vec<u8>, ClipboardError> {
Err(ClipboardError::UnsupportedAsync)
}
async fn clear_async(&self, _sel: Selection) -> Result<(), ClipboardError> {
Err(ClipboardError::UnsupportedAsync)
}
async fn available_async(&self, _sel: Selection) -> Result<Vec<MimeType>, ClipboardError> {
Err(ClipboardError::UnsupportedAsync)
}
}