fluent-ansi 0.4.0

A fluent interface for ANSI terminal colors and styles in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
macro_rules! impl_from_to {
    (#[doc = $doc:literal] fn $to_method:ident ( $self:ident : $from:ty ) -> $to:ty $impl:block) => {
        impl $from {
            #[doc = $doc]
            #[must_use]
            pub fn $to_method($self) -> $to {
                $impl
            }
        }

        impl From<$from> for $to {
            fn from(value: $from) -> Self {
                value.$to_method()
            }
        }
    };
}
pub(crate) use impl_from_to;