pub trait TruncatesString {
// Required method
fn truncate_bytes(&self, n: usize) -> &str;
}Required Methods§
Sourcefn truncate_bytes(&self, n: usize) -> &str
fn truncate_bytes(&self, n: usize) -> &str
Truncates the given string to around n bytes, on the closest UTF-8 code point boundary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".