fluent_ansi/
styling_element.rs1pub trait StylingElement<S> {
6 #[must_use]
8 fn add_to(self, style_set: S) -> S;
9}
10
11macro_rules! impl_styling_element_for {
12 {$type:ty {
13 args: [$self:ident, $composed_styling:ident];
14 add_to: $add_to:block
15 }} => {
16 impl $crate::StylingElement<$crate::Style> for $type {
17 fn add_to($self, $composed_styling: $crate::Style) -> $crate::Style {
18 $add_to
19 }
20 }
21
22 impl<C: core::fmt::Display> $crate::StylingElement<$crate::Styled<C>> for $type {
23 fn add_to($self, $composed_styling: $crate::Styled<C>) -> $crate::Styled<C> {
24 $add_to
25 }
26 }
27 };
28}
29pub(crate) use impl_styling_element_for;