Skip to main content

Styled

Trait Styled 

Source
pub trait Styled {
    type Item;

    // Required methods
    fn style(&self) -> Style;
    fn set_style<S>(self, style: S) -> Self::Item
       where S: Into<Style>;
}
Expand description

A trait for objects that have a Style.

This trait enables generic code to be written that can interact with any object that has a Style. This is used by the Stylize trait to allow generic code to be written that can interact with any object that can be styled.

Required Associated Types§

Required Methods§

Source

fn style(&self) -> Style

Returns the style of the object.

Source

fn set_style<S>(self, style: S) -> Self::Item
where S: Into<Style>,

Sets the style of the object.

style accepts any type that is convertible to Style (e.g. Style, Color, or your own type that implements Into<Style>).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Styled for bool

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <bool as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for char

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <char as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for f32

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <f32 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for f64

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <f64 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for i8

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <i8 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for i16

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <i16 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for i32

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <i32 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for i64

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <i64 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for i128

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <i128 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for isize

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <isize as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for u8

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <u8 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for u16

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <u16 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for u32

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <u32 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for u64

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <u64 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for u128

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <u128 as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for usize

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <usize as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for String

Source§

type Item = Span<'static>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <String as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Bar<'_>

Source§

type Item = Bar<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Bar<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for BarChart<'_>

Source§

type Item = BarChart<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <BarChart<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Block<'_>

Source§

type Item = Block<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Block<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Axis<'_>

Source§

type Item = Axis<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Axis<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Chart<'_>

Source§

type Item = Chart<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Chart<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Dataset<'_>

Source§

type Item = Dataset<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Dataset<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Gauge<'_>

Source§

type Item = Gauge<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Gauge<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for LineGauge<'_>

Source§

type Item = LineGauge<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <LineGauge<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for ListItem<'_>

Source§

type Item = ListItem<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <ListItem<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for List<'_>

Source§

type Item = List<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <List<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Paragraph<'_>

Source§

type Item = Paragraph<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Paragraph<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Sparkline<'_>

Source§

type Item = Sparkline<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Sparkline<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Cell<'_>

Source§

type Item = Cell<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Cell<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Row<'_>

Source§

type Item = Row<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Row<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl Styled for Tabs<'_>

Source§

type Item = Tabs<'_>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Tabs<'_> as Styled>::Item
where S: Into<Style>,

Source§

impl<'a> Styled for &'a str

Source§

type Item = Span<'a>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <&'a str as Styled>::Item
where S: Into<Style>,

Source§

impl<'a> Styled for Cow<'a, str>

Source§

type Item = Span<'a>

Source§

fn style(&self) -> Style

Source§

fn set_style<S>(self, style: S) -> <Cow<'a, str> as Styled>::Item
where S: Into<Style>,

Implementors§

Source§

impl Styled for Table<'_>

Source§

type Item = Table<'_>

Source§

impl Styled for Line<'_>

Source§

type Item = Line<'_>

Source§

impl Styled for Span<'_>

Source§

type Item = Span<'_>

Source§

impl Styled for Text<'_>

Source§

type Item = Text<'_>

Source§

impl Styled for StyledGrapheme<'_>