[][src]Struct clipboard_win::Clipboard

pub struct Clipboard { /* fields omitted */ }

Clipboard accessor.

Note:

You can have only one such accessor across your program.

Warning:

In Windows Clipboard opens globally and only one application can set data onto format at the time.

Therefore as soon as operations are finished, user is advised to close Clipboard.

Methods

impl Clipboard[src]

pub fn new() -> Result<Clipboard>[src]

Initializes new clipboard accessor.

Attempts to open clipboard.

pub fn empty(&self) -> Result<&Clipboard>[src]

Empties clipboard.

pub fn size(&self, format: u32) -> Option<usize>[src]

Retrieves size of clipboard content.

pub fn set(&self, format: u32, data: &[u8]) -> Result<()>[src]

Sets data onto clipboard with specified format.

Wraps raw::set()

pub fn set_string<T: ?Sized + AsRef<OsStr>>(&self, data: &T) -> Result<()>[src]

Sets str or String onto clipboard as Unicode format.

Under hood it transforms Rust UTF-8 String into UTF-16

pub fn get(&self, format: u32, data: &mut [u8]) -> Result<usize>[src]

Retrieves data of specified format from clipboard.

Wraps raw::get()

pub fn get_string(&self) -> Result<String>[src]

Retrieves String of CF_UNICODETEXT format from clipboard.

Wraps raw::get_string()

pub fn get_file_list(&self) -> Result<Vec<PathBuf>>[src]

Retrieves a list of file paths from the CF_HDROP format from the clipboard.

Wraps raw::get_file_list()

pub fn get_bit_map(&self) -> Result<Bitmap>[src]

Retrieves Bitmap of CF_BITMAP format from clipboard.

Important traits for EnumFormats
pub fn enum_formats(&self) -> EnumFormats[src]

Enumerator over all formats on clipboard..

pub fn seq_num() -> Option<u32>[src]

Returns Clipboard sequence number.

pub fn is_format_avail(format: u32) -> bool[src]

Determines whenever provided clipboard format is available on clipboard or not.

pub fn count_formats() -> Result<i32>[src]

Retrieves number of currently available formats on clipboard.

Trait Implementations

impl Drop for Clipboard[src]

Auto Trait Implementations

impl Send for Clipboard

impl Sync for Clipboard

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]