Trait tabled::grid::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: (usize, usize)) -> Option<&<&C as Colors>::Color>

source§

fn is_empty(&self) -> bool

source§

impl<C> Colors for BTreeMap<(usize, usize), C>
where C: ANSIFmt,

Available on crate feature std only.
§

type Color = C

source§

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

source§

fn is_empty(&self) -> bool

source§

impl<C> Colors for HashMap<(usize, usize), C>
where C: ANSIFmt,

Available on crate feature std only.
§

type Color = C

source§

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

source§

fn is_empty(&self) -> bool

Implementors§

source§

impl Colors for ColorMap

Available on crate feature std only.
source§

impl Colors for NoColors

source§

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

Available on crate feature std only.
§

type Color = C