IntoLocalStr

Trait IntoLocalStr 

Source
pub trait IntoLocalStr {
    // Required method
    fn into_local_str(self) -> LocalStr;
}
Expand description

A trait that converts the source to a LocalStr while consuming the original

use flexstr::local_str;

let a = local_str!("This is a wrapped static string literal no matter how long it is!!!!!");
assert!(a.is_static());

Required Methods§

Source

fn into_local_str(self) -> LocalStr

Converts the source to a LocalStr while consuming the original

Implementations on Foreign Types§

Source§

impl IntoLocalStr for String

Source§

fn into_local_str(self) -> LocalStr

use flexstr::IntoLocalStr;

let a = "This is a heap allocated string since it is a `String`".to_string().into_local_str();
assert!(a.is_heap());

Implementors§

Source§

impl<HEAP> IntoLocalStr for FlexStr<STRING_SIZED_INLINE, PTR_SIZED_PAD, PTR_SIZED_PAD, HEAP>
where HEAP: Deref<Target = str>,