Struct objc2::mutability::Immutable
source · pub struct Immutable { /* private fields */ }
Expand description
Marker type for immutable classes.
Note that immutable objects are often both Send
and Sync
, though
such implementations must be provided manually.
Functionality that is provided with this:
IsRetainable
->ClassType::retain
.IsIdCloneable
->Retained::clone
.IsAllocableAnyThread
->ClassType::alloc
.- You are allowed to hand out pointers / references to an instance’s internal data, since you know such data will never be mutated.
Trait Implementations§
source§impl Ord for Immutable
impl Ord for Immutable
source§impl PartialEq for Immutable
impl PartialEq for Immutable
source§impl PartialOrd for Immutable
impl PartialOrd for Immutable
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 Immutable
impl Eq for Immutable
impl Mutability for Immutable
impl StructuralPartialEq for Immutable
Auto Trait Implementations§
impl Freeze for Immutable
impl RefUnwindSafe for Immutable
impl Send for Immutable
impl Sync for Immutable
impl Unpin for Immutable
impl UnwindSafe for Immutable
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