Skip to main content

PyUtf8StrInterned

Type Alias PyUtf8StrInterned 

Source
pub type PyUtf8StrInterned = PyInterned<PyUtf8Str>;
Expand description

Interned PyUtf8Str — guaranteed UTF-8 at type level. Same layout as PyStrInterned due to #[repr(transparent)] on both PyInterned<T> and PyUtf8Str.

Aliased Type§

pub struct PyUtf8StrInterned { /* private fields */ }

Implementations§

Source§

impl PyUtf8StrInterned

Source

pub fn as_str(&self) -> &str

Returns the underlying &str.

Source

pub fn as_interned_str(&self) -> &PyStrInterned

View as PyStrInterned (widening: UTF-8 → WTF-8).

Source

pub unsafe fn from_str_interned_unchecked(s: &PyStrInterned) -> &Self

Narrow a PyStrInterned to PyUtf8StrInterned.

§Safety

The caller must ensure that the interned string is valid UTF-8.

Trait Implementations§

Source§

impl AsRef<str> for PyUtf8StrInterned

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Display for PyUtf8StrInterned

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more