pub trait BoundedWidth {
// Required method
fn bounded_width(&self) -> usize;
}Expand description
Support for returing the unicode width of text objects that are finite
Required Methods§
Sourcefn bounded_width(&self) -> usize
fn bounded_width(&self) -> usize
Return the finite unicode width of an object
§Example
use stylish_stringlike::text::BoundedWidth;
let foo = "foobar";
assert_eq!(foo.bounded_width(), 6);
let bar = String::from("🙈🙉🙊");
assert_eq!(bar.bounded_width(), 6);