Trait termfest::DisplayWidth [] [src]

pub trait DisplayWidth {
    fn display_width(&self) -> usize;
}

DisplayWidth provides a way to determine display width of characters or strings.

use termfest::DisplayWidth;

assert_eq!('あ'.display_width(), 2);
assert_eq!('a'.display_width(), 1);

assert_eq!("abc".display_width(), 3);
assert_eq!("あいう".display_width(), 6);

Required Methods

Implementations on Foreign Types

impl DisplayWidth for char
[src]

impl DisplayWidth for str
[src]

Implementors