Type Alias State

Source
pub type State<P> = Plain<P>;
Expand description

The internal state of a Text widget.

Aliased Type§

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

Implementations

Source§

impl<P: Paragraph> Plain<P>

Source

pub fn new(text: Text<String, P::Font>) -> Self

Creates a new Plain paragraph.

Source

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

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

Returns true if the Paragraph changed.

Source

pub fn align_x(&self) -> Alignment

Returns the horizontal alignment of the Paragraph.

Source

pub fn align_y(&self) -> Vertical

Returns the vertical alignment of the Paragraph.

Source

pub fn min_bounds(&self) -> Size

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

Source

pub fn min_width(&self) -> f32

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

Source

pub fn min_height(&self) -> f32

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

Source

pub fn raw(&self) -> &P

Returns the cached Paragraph.

Source

pub fn content(&self) -> &str

Returns the current content of the plain Paragraph.

Source

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

Returns the Paragraph as a Text definition.

Trait Implementations

Source§

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

Source§

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

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

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

Performs copy-assignment from source. Read more
Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

fn default() -> Plain<P>

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