devela::_dep::unicode_width

Trait UnicodeWidthChar

pub trait UnicodeWidthChar: Sealed {
    // Required method
    fn width(self) -> Option<usize> ;
}
Available on crate feature dep_unicode_width only.
Expand description

Methods for determining displayed width of Unicode characters.

Required Methods§

fn width(self) -> Option<usize>

Returns the character’s displayed width in columns, or None if the character is a control character.

This function treats characters in the Ambiguous category according to Unicode Standard Annex #11 as 1 column wide. This is consistent with the recommendations for non-CJK contexts, or when the context cannot be reliably determined.

Implementations on Foreign Types§

§

impl UnicodeWidthChar for char

§

fn width(self) -> Option<usize>

Implementors§