chore: add more impls of clipboard methods

This commit is contained in:
Ashley Wulber 2024-03-14 17:19:32 -04:00
parent 71df657777
commit 20e7cbedf5
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 60 additions and 0 deletions

View file

@ -27,6 +27,16 @@ pub trait AsMimeTypes {
fn as_bytes(&self, mime_type: &str) -> Option<Cow<'static, [u8]>>;
}
impl<T: AsMimeTypes + ?Sized> AsMimeTypes for Box<T> {
fn available(&self) -> Cow<'static, [String]> {
self.as_ref().available()
}
fn as_bytes(&self, mime_type: &str) -> Option<Cow<'static, [u8]>> {
self.as_ref().as_bytes(mime_type)
}
}
/// Data that can be stored to the clipboard.
pub struct ClipboardStoreData<T> {
/// Clipboard data.