Trait zero_copy_pads::UnicodeWidthStr[][src]

pub trait UnicodeWidthStr {
    pub fn width(&'a self) -> usize;
pub fn width_cjk(&'a self) -> usize; }

Methods for determining displayed width of Unicode strings.

Required methods

pub fn width(&'a self) -> usize[src]

Returns the string’s displayed width in columns.

Control characters are treated as having zero width.

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.

pub fn width_cjk(&'a self) -> usize[src]

Returns the string’s displayed width in columns.

Control characters are treated as having zero width.

This function treats characters in the Ambiguous category according to Unicode Standard Annex #11 as 2 column wide. This is consistent with the recommendations for CJK contexts.

Loading content...

Implementations on Foreign Types

impl UnicodeWidthStr for str[src]

Loading content...

Implementors

Loading content...