Trait objc2::mutability::IsRetainable
source · pub unsafe trait IsRetainable: Sealed + IsIdCloneable { }
Expand description
Marker trait for classes where the retain
selector is always safe.
Retained::clone
takes &Retained<T>
, while ClassType::retain
only
takes &T
; the difference between these two is that in the former case,
you know that there are no live mutable subclasses.
This is implemented for classes whose ClassType::Mutability
is one of:
This trait inherits IsIdCloneable
, so if a function is bound by this,
functionality given with that trait is available.
§Safety
This is a sealed trait, and should not need to be implemented. Open an issue if you know a use-case where this restrition should be lifted!