Trait GradientStr

Source
pub trait GradientStr {
    // Required method
    fn gradient<I>(&self, colors: I) -> GradientDisplay<'_, I>
       where I: IntoIterator<Item = RGB> + Clone,
             I::IntoIter: ExactSizeIterator + Clone;
}
Expand description

Methods to colorize string with a gradient.

Required Methods§

Source

fn gradient<I>(&self, colors: I) -> GradientDisplay<'_, I>

This function takes a list of colors, which represent a gradient, and colorizes the string.

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 GradientStr for &str

Source§

fn gradient<I>(&self, colors: I) -> GradientDisplay<'_, I>

Source§

impl GradientStr for str

Source§

fn gradient<I>(&self, colors: I) -> GradientDisplay<'_, I>

Implementors§