refactor: update smithay-clipboard
This commit is contained in:
parent
4e05e3c657
commit
5bfbaae180
9 changed files with 70 additions and 35 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue