[][src]Struct embedded_text::StyledTextBox

pub struct StyledTextBox<'a, C, F, A, V, H> where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    H: HeightMode
{ pub text_box: TextBox<'a>, pub style: TextBoxStyle<C, F, A, V, H>, }

A styled TextBox struct.

This structure is constructed by calling the into_styled method of a TextBox object. Use the draw method to draw the textbox on a display.

Fields

text_box: TextBox<'a>

A TextBox that has an associated TextBoxStyle.

style: TextBoxStyle<C, F, A, V, H>

The style of the TextBox.

Implementations

impl<C, F, A, V, H, '_> StyledTextBox<'_, C, F, A, V, H> where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

pub fn fit_height(&mut self) -> &mut Self[src]

Sets the height of the StyledTextBox to the height of the text.

pub fn fit_height_limited(&mut self, max_height: u32) -> &mut Self[src]

Sets the height of the StyledTextBox to the height of the text, limited to max_height.

This method allows you to set a maximum height. The StyledTextBox will take up at most max_height pixel vertical space.

Trait Implementations

impl<C, F, A, V, H, '_> Dimensions for StyledTextBox<'_, C, F, A, V, H> where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

impl<'a, C, F, A, V, H> Drawable<C> for &'a StyledTextBox<'a, C, F, A, V, H> where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    StyledTextBoxIterator<'a, C, F, A, V, H>: Iterator<Item = Pixel<C>>,
    StyledTextBox<'a, C, F, A, V, H>: StateFactory<'a, F>,
    H: HeightMode
[src]

impl<'a, C, F, V, H> StateFactory<'a, F> for StyledTextBox<'a, C, F, CenterAligned, V, H> where
    C: PixelColor,
    F: Font + Copy,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

type PixelIteratorState = State<'a, C, F>

The type of the state variable used for rendering.

impl<'a, C, F, V, H> StateFactory<'a, F> for StyledTextBox<'a, C, F, Justified, V, H> where
    C: PixelColor,
    F: Font + Copy,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

type PixelIteratorState = State<'a, C, F>

The type of the state variable used for rendering.

impl<'a, C, F, V, H> StateFactory<'a, F> for StyledTextBox<'a, C, F, LeftAligned, V, H> where
    C: PixelColor,
    F: Font + Copy,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

type PixelIteratorState = State<'a, C, F>

The type of the state variable used for rendering.

impl<'a, C, F, V, H> StateFactory<'a, F> for StyledTextBox<'a, C, F, RightAligned, V, H> where
    C: PixelColor,
    F: Font + Copy,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

type PixelIteratorState = State<'a, C, F>

The type of the state variable used for rendering.

impl<C, F, A, V, H, '_> Transform for StyledTextBox<'_, C, F, A, V, H> where
    C: PixelColor,
    F: Font + Copy,
    A: HorizontalTextAlignment,
    V: VerticalTextAlignment,
    H: HeightMode
[src]

Auto Trait Implementations

impl<'a, C, F, A, V, H> RefUnwindSafe for StyledTextBox<'a, C, F, A, V, H> where
    A: RefUnwindSafe,
    C: RefUnwindSafe,
    F: RefUnwindSafe,
    H: RefUnwindSafe,
    V: RefUnwindSafe

impl<'a, C, F, A, V, H> Send for StyledTextBox<'a, C, F, A, V, H> where
    A: Send,
    C: Send,
    F: Send,
    H: Send,
    V: Send

impl<'a, C, F, A, V, H> Sync for StyledTextBox<'a, C, F, A, V, H> where
    A: Sync,
    C: Sync,
    F: Sync,
    H: Sync,
    V: Sync

impl<'a, C, F, A, V, H> Unpin for StyledTextBox<'a, C, F, A, V, H> where
    A: Unpin,
    C: Unpin,
    F: Unpin,
    H: Unpin,
    V: Unpin

impl<'a, C, F, A, V, H> UnwindSafe for StyledTextBox<'a, C, F, A, V, H> where
    A: UnwindSafe,
    C: UnwindSafe,
    F: UnwindSafe,
    H: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.