Struct objc2::mutability::InteriorMutable
source · pub struct InteriorMutable { /* private fields */ }
Expand description
Marker type for classes that use interior mutability.
This is usually not Send + Sync
, unless the class is guaranteed to use
thread-safe operations.
Functionality that is provided with this:
IsRetainable
->ClassType::retain
.IsIdCloneable
->Id::clone
.IsAllocableAnyThread
->ClassType::alloc
.
Safety notice
When declaring classes, it is recommended that you wrap your instance
variables in Cell
, RefCell
, atomics or other similar interior
mutability abstractions to allow mutating your instance variables through
&self
.
Declared classes that use this cannot take &mut self
, except in
initializers.
Trait Implementations§
source§impl Clone for InteriorMutable
impl Clone for InteriorMutable
source§fn clone(&self) -> InteriorMutable
fn clone(&self) -> InteriorMutable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for InteriorMutable
impl Debug for InteriorMutable
source§impl Hash for InteriorMutable
impl Hash for InteriorMutable
source§impl Ord for InteriorMutable
impl Ord for InteriorMutable
source§fn cmp(&self, other: &InteriorMutable) -> Ordering
fn cmp(&self, other: &InteriorMutable) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<InteriorMutable> for InteriorMutable
impl PartialEq<InteriorMutable> for InteriorMutable
source§fn eq(&self, other: &InteriorMutable) -> bool
fn eq(&self, other: &InteriorMutable) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<InteriorMutable> for InteriorMutable
impl PartialOrd<InteriorMutable> for InteriorMutable
source§fn partial_cmp(&self, other: &InteriorMutable) -> Option<Ordering>
fn partial_cmp(&self, other: &InteriorMutable) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for InteriorMutable
impl Eq for InteriorMutable
impl Mutability for InteriorMutable
impl StructuralEq for InteriorMutable
impl StructuralPartialEq for InteriorMutable
Auto Trait Implementations§
impl RefUnwindSafe for InteriorMutable
impl Send for InteriorMutable
impl Sync for InteriorMutable
impl Unpin for InteriorMutable
impl UnwindSafe for InteriorMutable
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