pub struct Clipboard { /* private fields */ }Expand description
W3C Clipboard interface.
Implementations§
Source§impl Clipboard
impl Clipboard
Sourcepub fn write_text(&self, text: &str) -> Result<(), ClipboardError>
pub fn write_text(&self, text: &str) -> Result<(), ClipboardError>
Writes plain text to the clipboard.
Sourcepub fn read_text(&self) -> Result<String, ClipboardError>
pub fn read_text(&self) -> Result<String, ClipboardError>
Reads plain text from the clipboard.
Sourcepub fn write_data(&self, mime: &str, data: &[u8]) -> Result<(), ClipboardError>
pub fn write_data(&self, mime: &str, data: &[u8]) -> Result<(), ClipboardError>
Writes arbitrary MIME-typed data to the clipboard.
Sourcepub fn read_data(&self, mime: &str) -> Result<Option<Vec<u8>>, ClipboardError>
pub fn read_data(&self, mime: &str) -> Result<Option<Vec<u8>>, ClipboardError>
Reads MIME-typed data from the clipboard, returning None if the type is not present.
Sourcepub fn clear(&self) -> Result<(), ClipboardError>
pub fn clear(&self) -> Result<(), ClipboardError>
Clears all clipboard data.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Clipboard
impl Freeze for Clipboard
impl Move for Clipboard
impl RefUnwindSafe for Clipboard
impl Send for Clipboard
impl Sync for Clipboard
impl Unpin for Clipboard
impl UnsafeUnpin for Clipboard
impl UnwindSafe for Clipboard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more