Skip to main content

IntoString

Trait IntoString 

Source
pub trait IntoString {
    // Required method
    fn into_string(self) -> String;
}
Expand description

A similar trait to ToString, but avoiding an extra allocation when applied to a String

Required Methods§

Source

fn into_string(self) -> String

Converts value into string.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoString for Cow<'_, str>

Source§

impl IntoString for Box<str>

Source§

impl IntoString for String

Source§

impl<T: IntoString> IntoString for Box<T>

Source§

impl<T: ?Sized + ToString> IntoString for &T

Source§

default fn into_string(self) -> String

Implementors§