pub trait UnicodeWidthStr: Sealed { // Required methods fnwidth(&self) ->usize; fnwidth_cjk(&self) ->usize;}Expand description
Methods for determining displayed width of Unicode strings.
Required Methods§
Sourcefnwidth(&self) ->usize
fnwidth(&self) ->usize
Returns the string’s displayed width in columns.
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.
Sourcefnwidth_cjk(&self) ->usize
fnwidth_cjk(&self) ->usize
Returns the string’s displayed width in columns.
This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 2 column wide. This is consistent with the recommendations forCJK contexts.