pub trait UnicodeWidthChar: Sealed { // Required methods fnwidth(self) ->Option<usize>; fnwidth_cjk(self) ->Option<usize>;}Expand description
Methods for determining displayed width of Unicode characters.
Required Methods§
Sourcefnwidth(self) ->Option<usize>
fnwidth(self) ->Option<usize>
Returns the character’s displayed width in columns, orNone if thecharacter is a control character.
This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 1 column wide. This is consistent with the recommendations for non-CJKcontexts, or when the context cannot be reliably determined.
Sourcefnwidth_cjk(self) ->Option<usize>
fnwidth_cjk(self) ->Option<usize>
Returns the character’s displayed width in columns, orNone if thecharacter is a control character.
This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 2 columns wide. This is consistent with the recommendations forCJK contexts.