FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IClipboard

    trait · ferroui-base · v0.5.0

    trait IClipboard
    

    Represents the system clipboard.

    This interface is not meant to be implemented by applications.

    Every operation resolves to a ClipboardError when the platform clipboard fails (where the reference throws from the awaited task).

    View source

    Members

    clear_async

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

    Clears any data from the system clipboard.

    Source

    set_data_async

    fn set_data_async(self: &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.

    By calling this method, the clipboard will often be instantly cleared, and data will be lazily requested later when it is pasted.

    The data transfer must NOT be disposed by the caller after this call: the clipboard will dispose of it automatically when it becomes unused.

    Source

    flush_async

    fn flush_async(self: &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.

    This method is only supported on the Windows platform; it does nothing on other platforms.

    Source

    try_get_data_async

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

    Retrieves data previously stored on the clipboard.

    The returned data transfer MUST be disposed by the caller.

    Source

    try_get_in_process_data_async

    fn try_get_in_process_data_async(self: &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.

    This method cannot be used to retrieve a data transfer set by another process or by the system.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.