AsStr

Trait AsStr 

Source
pub trait AsStr {
    // Required method
    fn as_str(&self) -> &str;
}
Expand description

Trait defining instance method as_str() : &str that allows a type to expose its contiguous character representation to client code.

§Additional Implementations on Foreign Types

§Built-in Types

If the feature "implement-AsStr-for-built_ins" is defined (as it is by "default"), then this is also implemented for the following type(s):

§Standard Collection Types

If the feature "implement-AsStr-for-standard_collection_types" is defined (as it is by "default"), then this is also implemented for the following type(s):

Required Methods§

Source

fn as_str(&self) -> &str

Implementations on Foreign Types§

Source§

impl AsStr for &str

Source§

fn as_str(&self) -> &str

Source§

impl AsStr for str

Source§

fn as_str(&self) -> &str

Source§

impl AsStr for String

Source§

fn as_str(&self) -> &str

Source§

impl<T: AsStr + ?Sized> AsStr for Box<T>

Available on non-crate feature nostd only.
Source§

fn as_str(&self) -> &str

Source§

impl<T: AsStr + ?Sized> AsStr for Rc<T>

Available on non-crate feature nostd only.
Source§

fn as_str(&self) -> &str

Implementors§