Skip to main content

Text

Trait Text 

Source
pub trait Text {
    // Required methods
    fn text(&self) -> Fragment<'_>;
    fn select(&mut self, start: Point, end: Point, target: Target);
    fn select_all(&mut self);
    fn deselect(&mut self);
    fn copy(&mut self) -> Option<String>;
}
Expand description

The internal state of a widget that has text.

Required Methods§

Source

fn text(&self) -> Fragment<'_>

Returns the text of the widget.

Source

fn select(&mut self, start: Point, end: Point, target: Target)

Selects text between the given positions in layout coordinates.

start is the position where the user started selecting from, while end is the final position of the selection.

Source

fn select_all(&mut self)

Selects all the text of the widget.

Source

fn deselect(&mut self)

Deselects any selected text;

Source

fn copy(&mut self) -> Option<String>

Returns the selected text, if any.

Implementations on Foreign Types§

Source§

impl Text for String

Source§

fn text(&self) -> Fragment<'_>

Source§

fn select(&mut self, _start: Point, _end: Point, _target: Target)

Source§

fn select_all(&mut self)

Source§

fn deselect(&mut self)

Source§

fn copy(&mut self) -> Option<String>

Implementors§

Source§

impl<P: Paragraph> Text for Operand<'_, P>