Trait objc2::rc::AutoreleaseSafe
source · pub unsafe trait AutoreleaseSafe { }
Expand description
Marks types that are safe to pass across the closure in an
autoreleasepool
.
With the unstable-autoreleasesafe
feature enabled, this is an auto
trait that is implemented for all types except AutoreleasePool
.
Otherwise it is just a dummy trait that is implemented for all types; the safety invariants are checked with debug assertions instead.
You should not normally need to implement this trait yourself.
Safety
Must not be implemented for types that interract with the autorelease
pool. So if you reimplement the AutoreleasePool
struct or
likewise, this should be negatively implemented for that.
This can easily be accomplished with an PhantomData<AutoreleasePool>
if the unstable-autoreleasesafe
feature is enabled.