Type Alias State

pub type State<P> = Plain<P>;
Available on crate feature advanced only.
Expand description

The internal state of a Text widget.

Aliased Type§

struct State<P> { /* private fields */ }

Implementations

§

impl<P> Plain<P>
where P: Paragraph,

pub fn new(text: Text<String, <P as Paragraph>::Font>) -> Plain<P>

Creates a new Plain paragraph.

pub fn update(&mut self, text: Text<&str, <P as Paragraph>::Font>) -> bool

Updates the plain Paragraph to match the given Text, if needed.

Returns true if the Paragraph changed.

pub fn align_x(&self) -> Alignment

Returns the horizontal alignment of the Paragraph.

pub fn align_y(&self) -> Vertical

Returns the vertical alignment of the Paragraph.

pub fn min_bounds(&self) -> Size

Returns the minimum boundaries that can fit the contents of the Paragraph.

pub fn min_width(&self) -> f32

Returns the minimum width that can fit the contents of the Paragraph.

pub fn min_height(&self) -> f32

Returns the minimum height that can fit the contents of the Paragraph.

pub fn raw(&self) -> &P

Returns the cached Paragraph.

pub fn content(&self) -> &str

Returns the current content of the plain Paragraph.

pub fn as_text(&self) -> Text<&str, <P as Paragraph>::Font>

Returns the Paragraph as a Text definition.

Trait Implementations

§

impl<P> Clone for Plain<P>
where P: Clone + Paragraph,

§

fn clone(&self) -> Plain<P>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<P> Debug for Plain<P>
where P: Debug + Paragraph,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<P> Default for Plain<P>
where P: Default + Paragraph,

§

fn default() -> Plain<P>

Returns the “default value” for a type. Read more