pub trait Clipboard {
// Required methods
fn put(&mut self, slot: &Slot, item: ClipItem, origin: &Origin) -> Answer;
fn get(&self, slot: &Slot) -> Option<ClipItem>;
fn rev(&self) -> u64;
// Provided methods
fn offers(&self, slot: &Slot) -> Vec<FormatId> { ... }
fn may_use(&self, origin: &Origin, slot: &Slot) -> Result<(), String> { ... }
fn take_events(&mut self) -> Vec<(String, Json)> { ... }
fn system(&mut self) -> Option<&mut dyn SystemBackend> { ... }
}Expand description
The owner of the clipboard, as the interface reaches it.
Required Methods§
Provided Methods§
Sourcefn may_use(&self, origin: &Origin, slot: &Slot) -> Result<(), String>
fn may_use(&self, origin: &Origin, slot: &Slot) -> Result<(), String>
Whether origin may read and write slot: by default, the user
any slot, a session its own only (default_access).
Sourcefn take_events(&mut self) -> Vec<(String, Json)>
fn take_events(&mut self) -> Vec<(String, Json)>
The events to publish since the last call, as (name, data).
Sourcefn system(&mut self) -> Option<&mut dyn SystemBackend>
fn system(&mut self) -> Option<&mut dyn SystemBackend>
The owner’s own way to the system clipboard (a kernel writing
its private types there): it wins over the one installed with
set_backend, which wins over egui’s text.