Trait flexstr::IntoAFlexStr
source · [−]pub trait IntoAFlexStr {
fn into_a_flex_str(self) -> AFlexStr;
}Expand description
A trait that converts the source to a AFlexStr while consuming the original
use flexstr::IntoAFlexStr;
let a = "This is a wrapped static string literal no matter how long it is!!!!!".into_a_flex_str();
assert!(a.is_static());Required methods
fn into_a_flex_str(self) -> AFlexStr
fn into_a_flex_str(self) -> AFlexStr
Converts the source to an AFlexStr while consuming the original
Implementations on Foreign Types
sourceimpl IntoAFlexStr for &'static str
impl IntoAFlexStr for &'static str
sourcefn into_a_flex_str(self) -> AFlexStr
fn into_a_flex_str(self) -> AFlexStr
use flexstr::IntoAFlexStr;
let a = "This is a wrapped static string literal no matter how long it is!!!!!".into_a_flex_str();
assert!(a.is_static());sourceimpl IntoAFlexStr for String
impl IntoAFlexStr for String
sourcefn into_a_flex_str(self) -> AFlexStr
fn into_a_flex_str(self) -> AFlexStr
use flexstr::IntoAFlexStr;
let a = "This is a heap allocated string since it is a `String`".to_string().into_a_flex_str();
assert!(a.is_heap());sourceimpl IntoAFlexStr for char
impl IntoAFlexStr for char
sourcefn into_a_flex_str(self) -> AFlexStr
fn into_a_flex_str(self) -> AFlexStr
use flexstr::IntoAFlexStr;
let a = 't'.into_a_flex_str();
assert!(a.is_inlined());
assert_eq!(a, "t");