Trait UnicodeWidthStr
pub trait UnicodeWidthStr: Sealed {
// Required method
fn width(&self) -> usize ⓘ;
}
Available on crate feature
dep_unicode_width
only.Expand description
Methods for determining displayed width of Unicode strings.
Required Methods§
fn width(&self) -> usize ⓘ
fn width(&self) -> usize ⓘ
Returns the string’s displayed width in columns.
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.