Struct embedded_text::style::StyledTextBox

source ·
pub struct StyledTextBox<'a, C, F, A>
where C: PixelColor, F: Font + Copy, A: TextAlignment,
{ pub text_box: TextBox<'a>, pub style: TextBoxStyle<C, F, A>, }
Expand description

A styled TextBox struct.

Fields§

§text_box: TextBox<'a>

A TextBox that has an associated TextBoxStyle

§style: TextBoxStyle<C, F, A>

The style of the TextBox

Trait Implementations§

source§

impl<C, F, A> Dimensions for StyledTextBox<'_, C, F, A>
where C: PixelColor, F: Font + Copy, A: TextAlignment,

source§

fn top_left(&self) -> Point

Get the top left corner of the bounding box for an object
source§

fn bottom_right(&self) -> Point

Get the bottom right corner of the bounding box for an object
source§

fn size(&self) -> Size

Get the width and height for an object
source§

impl<'a, C, F, A> Drawable<C> for &'a StyledTextBox<'a, C, F, A>
where C: PixelColor, F: Font + Copy, A: TextAlignment, StyledTextBoxIterator<'a, C, F, A>: Iterator<Item = Pixel<C>>, StyledTextBox<'a, C, F, A>: StateFactory,

source§

fn draw<D: DrawTarget<C>>(self, display: &mut D) -> Result<(), D::Error>

Draw the graphics object using the supplied DrawTarget.
source§

impl<'a, C, F> StateFactory for StyledTextBox<'a, C, F, CenterAligned>
where C: PixelColor, F: Font + Copy,

§

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

The type of the state variable used for rendering.
source§

fn create_state(&self) -> Self::PixelIteratorState

Creates a new state variable.
source§

impl<'a, C, F> StateFactory for StyledTextBox<'a, C, F, Justified>
where C: PixelColor, F: Font + Copy,

§

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

The type of the state variable used for rendering.
source§

fn create_state(&self) -> Self::PixelIteratorState

Creates a new state variable.
source§

impl<'a, C, F> StateFactory for StyledTextBox<'a, C, F, LeftAligned>
where C: PixelColor, F: Font + Copy,

§

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

The type of the state variable used for rendering.
source§

fn create_state(&self) -> Self::PixelIteratorState

Creates a new state variable.
source§

impl<'a, C, F> StateFactory for StyledTextBox<'a, C, F, RightAligned>
where C: PixelColor, F: Font + Copy,

§

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

The type of the state variable used for rendering.
source§

fn create_state(&self) -> Self::PixelIteratorState

Creates a new state variable.
source§

impl<C, F, A> Transform for StyledTextBox<'_, C, F, A>
where C: PixelColor, F: Font + Copy, A: TextAlignment,

source§

fn translate(&self, by: Point) -> Self

Move the origin of an object by a given number of (x, y) pixels, returning a new object
source§

fn translate_mut(&mut self, by: Point) -> &mut Self

Move the origin of an object by a given number of (x, y) pixels, mutating the object in place

Auto Trait Implementations§

§

impl<'a, C, F, A> Freeze for StyledTextBox<'a, C, F, A>
where A: Freeze, F: Freeze, C: Freeze,

§

impl<'a, C, F, A> RefUnwindSafe for StyledTextBox<'a, C, F, A>

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.