refactor: update smithay-clipboard

This commit is contained in:
Ashley Wulber 2024-03-26 17:32:09 -04:00
parent 4e05e3c657
commit 5bfbaae180
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
9 changed files with 70 additions and 35 deletions

View file

@ -4,6 +4,23 @@ pub mod platform;
use std::{borrow::Cow, error, fmt};
/// Raw data from the clipboard
pub struct ClipboardData(pub Vec<u8>, pub String);
impl AllowedMimeTypes for ClipboardData {
fn allowed() -> Cow<'static, [String]> {
Cow::Owned(vec![])
}
}
impl TryFrom<(Vec<u8>, String)> for ClipboardData {
type Error = Error;
fn try_from((data, mime): (Vec<u8>, String)) -> Result<Self, Self::Error> {
Ok(ClipboardData(data, mime))
}
}
/// Data that can be loaded from the clipboard.
pub struct ClipboardLoadData<T>(pub T);