[][src]Struct embedded_text::prelude::TextStyle

#[non_exhaustive]pub struct TextStyle<C, F> where
    C: PixelColor,
    F: Font
{ pub text_color: Option<C>, pub background_color: Option<C>, pub font: F, }

Style properties for text.

A TextStyle can be applied to a Text object to define how the text is drawn.

Because TextStyle has the non_exhaustive attribute, it cannot be created using a struct literal. To create a TextStyle, use the text_style! macro or TextStyleBuilder.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
text_color: Option<C>

Text color.

background_color: Option<C>

Background color.

font: F

Font.

Implementations

impl<C, F> TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

pub fn new(font: F, text_color: C) -> TextStyle<C, F>[src]

Creates a text style with transparent background.

Trait Implementations

impl<C, F> Clone for TextStyle<C, F> where
    C: Clone + PixelColor,
    F: Clone + Font
[src]

impl<C, F> Copy for TextStyle<C, F> where
    C: Copy + PixelColor,
    F: Copy + Font
[src]

impl<C, F> Debug for TextStyle<C, F> where
    C: Debug + PixelColor,
    F: Debug + Font
[src]

impl<C, F> Default for TextStyle<C, F> where
    C: Default + PixelColor,
    F: Default + Font
[src]

impl<C, F> Eq for TextStyle<C, F> where
    C: Eq + PixelColor,
    F: Eq + Font
[src]

impl<C, F> Hash for TextStyle<C, F> where
    C: Hash + PixelColor,
    F: Hash + Font
[src]

impl<C, F> Ord for TextStyle<C, F> where
    C: Ord + PixelColor,
    F: Ord + Font
[src]

impl<C, F> PartialEq<TextStyle<C, F>> for TextStyle<C, F> where
    C: PartialEq<C> + PixelColor,
    F: PartialEq<F> + Font
[src]

impl<C, F> PartialOrd<TextStyle<C, F>> for TextStyle<C, F> where
    C: PartialOrd<C> + PixelColor,
    F: PartialOrd<F> + Font
[src]

Auto Trait Implementations

impl<C, F> RefUnwindSafe for TextStyle<C, F> where
    C: RefUnwindSafe,
    F: RefUnwindSafe

impl<C, F> Send for TextStyle<C, F> where
    C: Send,
    F: Send

impl<C, F> Sync for TextStyle<C, F> where
    C: Sync,
    F: Sync

impl<C, F> Unpin for TextStyle<C, F> where
    C: Unpin,
    F: Unpin

impl<C, F> UnwindSafe for TextStyle<C, F> where
    C: UnwindSafe,
    F: 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.