Skip to main content

Clipboard

Struct Clipboard 

Source
pub struct Clipboard { /* private fields */ }
Expand description

Implementation of IClipboard on top of a platform clipboard.

Implementations§

Source§

impl Clipboard

Source

pub fn new(clipboard_impl: Rc<dyn IClipboardImpl>) -> Rc<Clipboard>

Creates the clipboard for a platform implementation.

Trait Implementations§

Source§

impl IClipboard for Clipboard

Source§

fn clear_async(&self) -> LocalBoxFuture<Result<(), ClipboardError>>

Clears any data from the system clipboard.
Source§

fn set_data_async( &self, data_transfer: Option<Rc<dyn IAsyncDataTransfer>>, ) -> LocalBoxFuture<Result<(), ClipboardError>>

Places a data object on the clipboard. The data may be queried lazily by the system: the data transfer must stay valid until the clipboard is cleared or replaced. None clears the clipboard. Read more
Source§

fn flush_async(&self) -> LocalBoxFuture<Result<(), ClipboardError>>

Permanently adds the data that is on the clipboard so that it is available after the data’s original application closes. Read more
Source§

fn try_get_data_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<dyn IAsyncDataTransfer>>, ClipboardError>>

Retrieves data previously stored on the clipboard. Read more
Source§

fn try_get_in_process_data_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<dyn IAsyncDataTransfer>>, ClipboardError>>

Retrieves the exact instance of a data transfer previously placed on the clipboard by set_data_async, if any. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<I> ClipboardExtensions for I
where I: IClipboard + ?Sized,

Source§

fn get_data_formats_async( &self, ) -> LocalBoxFuture<Result<Rc<[DataFormat]>, ClipboardError>>

Returns a list containing the formats currently available from the clipboard. It is empty if the clipboard is empty.
Source§

fn try_get_value_async<T: Clone + 'static>( &self, format: &DataFormatOf<T>, ) -> LocalBoxFuture<Result<Option<T>, ClipboardError>>

Tries to get a value for a given format from the clipboard. The future resolves to None if the format is not supported. Read more
Source§

fn try_get_values_async<T: Clone + 'static>( &self, format: &DataFormatOf<T>, ) -> LocalBoxFuture<Result<Option<Vec<T>>, ClipboardError>>

Tries to get multiple values for a given format from the clipboard. The future resolves to None if the format is not supported.
Source§

fn set_value_async<T: 'static>( &self, format: &DataFormatOf<T>, value: Option<T>, ) -> LocalBoxFuture<Result<(), ClipboardError>>

Places a single value on the clipboard in the specified format. Read more
Source§

fn set_values_async<T: 'static>( &self, format: &DataFormatOf<T>, values: Option<impl IntoIterator<Item = T>>, ) -> LocalBoxFuture<Result<(), ClipboardError>>
where Self: Sized,

Places multiple values on the clipboard in the specified format. Read more
Source§

fn try_get_text_async( &self, ) -> LocalBoxFuture<Result<Option<String>, ClipboardError>>

Returns a text, if available, from the clipboard.
Source§

fn try_get_file_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<dyn IStorageItem>>, ClipboardError>>

Returns a file (or folder), if available, from the clipboard.
Source§

fn try_get_files_async( &self, ) -> LocalBoxFuture<Result<Option<Vec<Rc<dyn IStorageItem>>>, ClipboardError>>

Returns the files (or folders), if available, from the clipboard.
Source§

fn try_get_bitmap_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<Bitmap>>, ClipboardError>>

Returns a bitmap, if available, from the clipboard.
Source§

fn set_text_async( &self, text: Option<&str>, ) -> LocalBoxFuture<Result<(), ClipboardError>>

Places a text on the clipboard. Read more
Source§

fn set_file_async( &self, file: Option<Rc<dyn IStorageItem>>, ) -> LocalBoxFuture<Result<(), ClipboardError>>

Places a file (or folder) on the clipboard. Read more
Source§

fn set_files_async( &self, files: Option<impl IntoIterator<Item = Rc<dyn IStorageItem>>>, ) -> LocalBoxFuture<Result<(), ClipboardError>>
where Self: Sized,

Places a list of files (or folders) on the clipboard. Read more
Source§

fn set_bitmap_async( &self, bitmap: Option<Rc<Bitmap>>, ) -> LocalBoxFuture<Result<(), ClipboardError>>

Places a bitmap on the clipboard. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.