Struct clipboard_win::Clipboard
source · pub struct Clipboard { /* private fields */ }
Expand description
Implementations
sourceimpl Clipboard
impl Clipboard
sourcepub fn new() -> Result<Clipboard>
pub fn new() -> Result<Clipboard>
Initializes new clipboard accessor.
Attempts to open clipboard.
sourcepub fn set(&self, format: u32, data: &[u8]) -> Result<()>
pub fn set(&self, format: u32, data: &[u8]) -> Result<()>
Sets data onto clipboard with specified format.
Wraps raw::set()
sourcepub fn set_string<T: ?Sized + AsRef<OsStr>>(&self, data: &T) -> Result<()>
pub fn set_string<T: ?Sized + AsRef<OsStr>>(&self, data: &T) -> Result<()>
Sets str
or String
onto clipboard as Unicode format.
Under hood it transforms Rust UTF-8
String into UTF-16
sourcepub fn get(&self, format: u32, data: &mut [u8]) -> Result<usize>
pub fn get(&self, format: u32, data: &mut [u8]) -> Result<usize>
Retrieves data of specified format from clipboard.
Wraps raw::get()
sourcepub fn get_string(&self) -> Result<String>
pub fn get_string(&self) -> Result<String>
Retrieves String
of CF_UNICODETEXT
format from clipboard.
Wraps raw::get_string()
sourcepub fn enum_formats(&self) -> EnumFormats ⓘ
pub fn enum_formats(&self) -> EnumFormats ⓘ
Enumerator over all formats on clipboard..
sourcepub fn is_format_avail(format: u32) -> bool
pub fn is_format_avail(format: u32) -> bool
Determines whenever provided clipboard format is available on clipboard or not.
sourcepub fn count_formats() -> Result<i32>
pub fn count_formats() -> Result<i32>
Retrieves number of currently available formats on clipboard.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Clipboard
impl Send for Clipboard
impl Sync for Clipboard
impl Unpin for Clipboard
impl UnwindSafe for Clipboard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more