pyo3::sync

Struct Interned

Source
#[doc(hidden)] pub struct Interned(&'static str, GILOnceCell<Py<PyString>>);
Expand description

Implementation detail for intern! macro.

Tuple Fields§

§0: &'static str§1: GILOnceCell<Py<PyString>>

Implementations§

Source§

impl Interned

Source

pub const fn new(value: &'static str) -> Self

Creates an empty holder for an interned str.

Source

pub fn get<'py>(&self, py: Python<'py>) -> &Bound<'py, PyString>

Gets or creates the interned str value.

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here