Skip to main content

Text

Trait Text 

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

Immutable UTF-8 text while its field owner is shared.

Required Methods§

Source

fn as_str(&self) -> &str

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Text for Cow<'_, str>

Source§

fn as_str(&self) -> &str

Source§

impl Text for String

Source§

fn as_str(&self) -> &str

Source§

impl Text for str

Source§

fn as_str(&self) -> &str

Source§

impl<T: Text + ?Sized> Text for &T

Source§

fn as_str(&self) -> &str

Source§

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

Source§

fn as_str(&self) -> &str

Implementors§

Source§

impl<T: Constant> Text for Static<T>