Skip to main content

Text

Trait Text 

pub trait Text {
    // Required methods
    fn text(&self) -> Cow<'_, str>;
    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>;
}
Available on crate feature advanced only.
Expand description

The internal state of a widget that has text.

Required Methods§

fn text(&self) -> Cow<'_, str>

Returns the text of the widget.

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.

fn select_all(&mut self)

Selects all the text of the widget.

fn deselect(&mut self)

Deselects any selected text;

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

Returns the selected text, if any.

Implementations on Foreign Types§

§

impl Text for String

§

fn text(&self) -> Cow<'_, str>

§

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>

Implementors§

§

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