ToSmallStr

Trait ToSmallStr 

Source
pub trait ToSmallStr {
    // Required method
    fn to_smallstr<const N: usize>(&self) -> SmallStr<N>;
}

Required Methods§

Source

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.

Implementors§

Source§

impl<T: Display + ?Sized> ToSmallStr for T