Traitunicode_width::UnicodeWidthStr [−][src]
pub trait UnicodeWidthStr { fnwidth<'a>(&'a self) ->usize; fnwidth_cjk<'a>(&'a self) ->usize;}
Methods for determining displayed width of Unicode strings.
Required Methods
fnwidth<'a>(&'a self) ->usize
Returns the string's displayed width in columns.
Control characters are treated as having zero width.
This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 1 column wide. This is consistent with the recommendations fornon-CJK contexts, or when the context cannot be reliably determined.
fnwidth_cjk<'a>(&'a self) ->usize
Returns the string's displayed width in columns.
Control characters are treated as having zero width.
This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 2 column wide. This is consistent with the recommendations forCJK contexts.
Implementors
implUnicodeWidthStr forstr