Skip to main content

HasSelectionData

Trait HasSelectionData 

Source
pub trait HasSelectionData: Any {
    // Required method
    fn as_any(&self) -> &dyn Any;

    // Provided method
    fn selection(&self) -> Option<TextSelection> { ... }
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

return self as Any

Provided Methods§

Source

fn selection(&self) -> Option<TextSelection>

The selection inside a text control.

Return None when the event did not originate from a text control with selection offsets. Document selections should use a separate API instead of being mixed into this payload.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HasSelectionData for SerializedSelectionData

Available on crate feature serialize only.