Skip to main content

StringOrStr

Trait StringOrStr 

Source
pub trait StringOrStr: Sealed {
    // Required method
    fn to_string(self) -> String;
}
Expand description

A trait implemented by String and &str.

This is more specific than AsRef<str>, which can accidentally include many other undesired types.

Required Methods§

Source

fn to_string(self) -> String

Convert this object to a String.

Implementations on Foreign Types§

Source§

impl StringOrStr for String

Source§

impl<'a> StringOrStr for &'a str

Implementors§