pub trait StringExt {
// Required methods
fn char_count(&self) -> u32;
fn char_index(&self, offset: u32) -> usize;
fn char_slice(&self, start: u32, end: u32) -> &str;
fn char_slice_from(&self, start: u32) -> &str;
}Expand description
Extension trait that adds methods used for working with Strings and &strs in terms of their UTF-8 characters, as opposed to bytes
Required Methods§
fn char_count(&self) -> u32
fn char_index(&self, offset: u32) -> usize
fn char_slice(&self, start: u32, end: u32) -> &str
fn char_slice_from(&self, start: u32) -> &str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".