StringWrapper

Trait StringWrapper 

Source
pub trait StringWrapper:
    Borrow<String>
    + Clone
    + Eq
    + From<String>
    + Hash {
    // Required methods
    fn into_owned(self) -> String;
    fn as_str(&self) -> &str;
}
Expand description

An interface for any Cloneable wrapper around a String.

Required Methods§

Source

fn into_owned(self) -> String

Unwrap to an owned String.

Source

fn as_str(&self) -> &str

Borrow the contents as a slice.

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.

Implementations on Foreign Types§

Source§

impl StringWrapper for Box<String>

Source§

fn into_owned(self) -> String

Source§

fn as_str(&self) -> &str

Source§

impl StringWrapper for Rc<String>

Source§

fn into_owned(self) -> String

Source§

fn as_str(&self) -> &str

Source§

impl StringWrapper for String

Source§

fn into_owned(self) -> String

Source§

fn as_str(&self) -> &str

Source§

impl StringWrapper for Arc<String>

Source§

fn into_owned(self) -> String

Source§

fn as_str(&self) -> &str

Implementors§