[][src]Trait embedded_text::rendering::StateFactory

pub trait StateFactory<'a, F: Font> {
    type PixelIteratorState;
    fn create_state(
        &self,
        cursor: Cursor<F>,
        parser: Parser<'a>
    ) -> Self::PixelIteratorState; }

This trait is used to associate a state type to a horizontal alignment option.

Implementing this trait is only necessary when creating new alignment algorithms.

Associated Types

type PixelIteratorState

The type of the state variable used for rendering.

Loading content...

Required methods

fn create_state(
    &self,
    cursor: Cursor<F>,
    parser: Parser<'a>
) -> Self::PixelIteratorState

Creates a new state variable.

Loading content...

Implementors

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>

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>

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>

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>

Loading content...