Struct pyo3::buffer::ReadOnlyCell

source ·
#[repr(transparent)]
pub struct ReadOnlyCell<T: Element>(_);
Available on non-Py_LIMITED_API or Py_3_11 only.
Expand description

Like std::cell::Cell, but only provides read-only access to the data.

&ReadOnlyCell<T> is basically a safe version of *const T: The data cannot be modified through the reference, but other references may be modifying the data.

Implementations

Returns a copy of the current value.

Returns a pointer to the current value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.