Skip to main content

ClipSource

Trait ClipSource 

Source
pub trait ClipSource {
    // Required method
    fn copy(&self, app: &AppHandle) -> Option<ClipItem>;

    // Provided methods
    fn copy_element(
        &self,
        app: &AppHandle,
        element: Option<&str>,
    ) -> Option<ClipItem> { ... }
    fn can_copy(&self, _app: &AppHandle) -> bool { ... }
    fn can_cut(&self, _app: &AppHandle) -> bool { ... }
    fn delete(&self, _app: &AppHandle, _cut: &Cut<'_>) -> Result<(), String> { ... }
}
Expand description

What a copy takes from a component.

Required Methods§

Source

fn copy(&self, app: &AppHandle) -> Option<ClipItem>

The selection as an item; None: nothing to copy.

Provided Methods§

Source

fn copy_element( &self, app: &AppHandle, element: Option<&str>, ) -> Option<ClipItem>

What a copy takes from one element of the endpoint (a node, a row: the key its widget was bound with, bind_element, or the one a request named); by default ClipSource::copy, whatever the element.

Source

fn can_copy(&self, _app: &AppHandle) -> bool

Whether a copy would take something now (canCopy).

Source

fn can_cut(&self, _app: &AppHandle) -> bool

Whether a cut may delete the selection now (canCut); by default a source copies only.

Source

fn delete(&self, _app: &AppHandle, _cut: &Cut<'_>) -> Result<(), String>

Deletes what a cut copies; an error refuses the cut, and nothing is copied.

Implementors§