[][src]Struct iced::widget::text::Text

pub struct Text<Color> { /* fields omitted */ }

A fragment of text with a generic Color.

It implements Widget when the associated Renderer implements the text::Renderer trait.

Example

use iced::Text;

#[derive(Debug, Clone, Copy)]
pub enum Color {
    Black,
}

Text::new("I <3 iced!")
    .size(40)
    .color(Color::Black);

Methods

impl<Color> Text<Color>[src]

pub fn new(label: &str) -> Self[src]

Create a new fragment of Text with the given contents.

pub fn size(self, size: u16) -> Self[src]

Sets the size of the Text in pixels.

pub fn color(self, color: Color) -> Self[src]

Sets the Color of the Text.

pub fn width(self, width: u16) -> Self[src]

Sets the width of the Text boundaries in pixels.

pub fn height(self, height: u16) -> Self[src]

Sets the height of the Text boundaries in pixels.

pub fn horizontal_alignment(self, alignment: HorizontalAlignment) -> Self[src]

Sets the HorizontalAlignment of the Text.

pub fn vertical_alignment(self, alignment: VerticalAlignment) -> Self[src]

Sets the VerticalAlignment of the Text.

Trait Implementations

impl<Message, Renderer, Color> Widget<Message, Renderer> for Text<Color> where
    Color: Copy + Debug,
    Renderer: Renderer<Color>, 
[src]

impl<Color: Clone> Clone for Text<Color>[src]

impl<'a, Message, Renderer, Color> From<Text<Color>> for Element<'a, Message, Renderer> where
    Color: 'static + Copy + Debug,
    Renderer: Renderer<Color>, 
[src]

impl<Color: Debug> Debug for Text<Color>[src]

Auto Trait Implementations

impl<Color> Sync for Text<Color> where
    Color: Sync

impl<Color> Send for Text<Color> where
    Color: Send

impl<Color> Unpin for Text<Color> where
    Color: Unpin

impl<Color> UnwindSafe for Text<Color> where
    Color: UnwindSafe

impl<Color> RefUnwindSafe for Text<Color> where
    Color: RefUnwindSafe

Blanket Implementations

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> From<T> for 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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,