TextWidget

Trait TextWidget 

Source
pub trait TextWidget: Failable {
    // Required methods
    fn text(&self) -> Result<String, Self::Error>;
    fn set_text(&mut self, s: impl AsRef<str>) -> Result<(), Self::Error>;
}
Expand description

Common trait for widgets that have text.

Required Methods§

Source

fn text(&self) -> Result<String, Self::Error>

Get the text of the widget.

Source

fn set_text(&mut self, s: impl AsRef<str>) -> Result<(), Self::Error>

Set the text of the widget.

If the widget supports multiline strings, lines are separated with \n. You don’t need to handle CRLF.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§