Skip to main content

Utf8Len

Trait Utf8Len 

Source
pub trait Utf8Len {
    // Required methods
    fn utf8_len_at<T>(&self, idx: T) -> usize
       where usize: Cast<T>;
    fn utf8_count(&self) -> usize;
    fn utf8_slice(&self, r: impl uRange) -> &str;
    fn slice(&self, r: impl uRange) -> &str;
}

Required Methods§

Source

fn utf8_len_at<T>(&self, idx: T) -> usize
where usize: Cast<T>,

Source

fn utf8_count(&self) -> usize

Source

fn utf8_slice(&self, r: impl uRange) -> &str

Source

fn slice(&self, r: impl uRange) -> &str

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Utf8Len for str

Source§

fn utf8_len_at<T>(&self, char_idx: T) -> usize
where usize: Cast<T>,

Source§

fn utf8_count(&self) -> usize

Source§

fn utf8_slice(&self, r: impl uRange) -> &str

Source§

fn slice(&self, r: impl uRange) -> &str

Implementors§