Skip to main content

StringExt

Trait StringExt 

Source
pub trait StringExt {
    // Required method
    fn truncate_chars(&self, len: usize) -> String;
}
Expand description

String conveniences (Rails truncate).

Required Methods§

Source

fn truncate_chars(&self, len: usize) -> String

Truncate to at most len characters, appending when cut.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StringExt for str

Implementors§