Trait Colors

Source
pub trait Colors {
    type Color: ANSIFmt;

    // Required methods
    fn get_color(&self, pos: Position) -> Option<&Self::Color>;
    fn is_empty(&self) -> bool;
}
Expand description

A trait which represents map of colors.

Required Associated Types§

Source

type Color: ANSIFmt

Color implementation.

Required Methods§

Source

fn get_color(&self, pos: Position) -> Option<&Self::Color>

Returns a color for a given position.

Source

fn is_empty(&self) -> bool

Verifies whether a map is empty or not.

Implementations on Foreign Types§

Source§

impl<C> Colors for &C
where C: Colors,

Source§

type Color = <C as Colors>::Color

Source§

fn get_color(&self, pos: Position) -> Option<&<&C as Colors>::Color>

Source§

fn is_empty(&self) -> bool

Source§

impl<C> Colors for BTreeMap<Position, C>
where C: ANSIFmt,

Source§

type Color = C

Source§

fn get_color( &self, pos: Position, ) -> Option<&<BTreeMap<Position, C> as Colors>::Color>

Source§

fn is_empty(&self) -> bool

Source§

impl<C> Colors for HashMap<Position, C>
where C: ANSIFmt,

Source§

type Color = C

Source§

fn get_color( &self, pos: Position, ) -> Option<&<HashMap<Position, C> as Colors>::Color>

Source§

fn is_empty(&self) -> bool

Implementors§