pub trait ToSmallStr {
// Required method
fn to_smallstr<const N: usize>(&self) -> SmallStr<N>;
}Required Methods§
Sourcefn to_smallstr<const N: usize>(&self) -> SmallStr<N>
fn to_smallstr<const N: usize>(&self) -> SmallStr<N>
Converts the given value to a SmallStr.
§Examples
use small_str::{SmallString, ToSmallStr};
let i = 5;
let five = SmallString::from("5");
assert_eq!(five, i.to_smallstr());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.