Trait papergrid::colors::Colors

source ·
pub trait Colors {
    type Color: ANSIFmt;

    // Required methods
    fn get_color(&self, pos: (usize, usize)) -> 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: (usize, usize)) -> 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,

§

type Color = <C as Colors>::Color

source§

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

source§

fn is_empty(&self) -> bool

source§

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

§

type Color = C

source§

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

source§

fn is_empty(&self) -> bool

source§

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

§

type Color = C

source§

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

source§

fn is_empty(&self) -> bool

Implementors§

source§

impl Colors for NoColors

source§

impl<C> Colors for EntityMap<Option<C>>
where C: ANSIFmt,

§

type Color = C