Skip to main content

EventTransfer

Trait EventTransfer 

pub trait EventTransfer {
    // Required methods
    fn set_text(&self, text: &str) -> bool;
    fn text(&self) -> Option<String>;

    // Provided method
    fn rich_text(&self) -> Option<RichTextOffer> { ... }
}
Expand description

The data of one trusted clipboard event (the browser’s DataTransfer).

Required Methods§

fn set_text(&self, text: &str) -> bool

Offer text as text/plain. Returns whether the event took it.

fn text(&self) -> Option<String>

The event’s text/plain, if any.

Provided Methods§

fn rich_text(&self) -> Option<RichTextOffer>

Paired HTML/plain payloads from this same event. Optional and bounded; returning None leaves the ordinary plain-text read available.

Implementors§