Struct ReadOnlyCell
pub struct ReadOnlyCell<T>(/* private fields */)
where
T: Element;Available on crate feature
tls and (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§
Auto Trait Implementations§
impl<T> !Freeze for ReadOnlyCell<T>
impl<T> !RefUnwindSafe for ReadOnlyCell<T>
impl<T> Send for ReadOnlyCell<T>where
T: Send,
impl<T> !Sync for ReadOnlyCell<T>
impl<T> Unpin for ReadOnlyCell<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReadOnlyCell<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReadOnlyCell<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more