[−][src]Trait zerogc::GcSafe
Indicates that a type can be safely allocated by a garbage collector.
Safety
Custom destructors must never reference garbage collected pointers. The garbage collector may have already freed the other objects before calling this type's drop function.
Unlike java finalizers, this allows us to deallocate objects normally and avoids a second pass over the objects to check for resurrected objects.
Associated Constants
const NEEDS_DROP: bool
If this type needs a destructor run
This is usually equivalent to std::mem::needs_drop
.
However procedurally derived code can sometimes provide
a no-op drop implementation (for safety),
which would lead to a false positive with std::mem::needs_drop()
Implementations on Foreign Types
impl GcSafe for i8
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for i16
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for i32
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for i64
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for isize
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for u8
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for u16
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for u32
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for u64
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for usize
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for f32
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for f64
[src]
No drop/custom behavior -> GcSafe
const NEEDS_DROP: bool
[src]
impl GcSafe for ()
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe> GcSafe for (A,)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe> GcSafe for (A, B)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe> GcSafe for (A, B, C)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe> GcSafe for (A, B, C, D)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe> GcSafe for (A, B, C, D, E)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe, F: GcSafe> GcSafe for (A, B, C, D, E, F)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe, F: GcSafe, G: GcSafe> GcSafe for (A, B, C, D, E, F, G)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe, F: GcSafe, G: GcSafe, H: GcSafe> GcSafe for (A, B, C, D, E, F, G, H)
[src]
const NEEDS_DROP: bool
[src]
impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe, F: GcSafe, G: GcSafe, H: GcSafe, I: GcSafe> GcSafe for (A, B, C, D, E, F, G, H, I)
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 0]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 1]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 2]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 3]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 4]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 5]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 6]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 7]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 8]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 9]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 10]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 11]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 12]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 13]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 14]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 15]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 16]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 17]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 18]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 19]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 20]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 24]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 32]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 48]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 64]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 100]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 128]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 256]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 512]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 1024]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 2048]
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T; 4096]
[src]
const NEEDS_DROP: bool
[src]
impl<'a, T: GcSafe + TraceImmutable> GcSafe for &'a T
[src]
const NEEDS_DROP: bool
[src]
impl<'a, T: GcSafe> GcSafe for &'a mut T
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for [T]
[src]
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for Vec<T> where
T: GcSafe,
[src]
T: GcSafe,
We trust ourselves to not do anything bad as long as our paramaters don't
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for Box<T> where
T: GcSafe,
[src]
T: GcSafe,
We trust ourselves to not do anything bad as long as our paramaters don't
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for Rc<T> where
T: GcSafe + TraceImmutable,
[src]
T: GcSafe + TraceImmutable,
We trust ourselves to not do anything bad as long as our paramaters don't
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for Arc<T> where
T: GcSafe + TraceImmutable,
[src]
T: GcSafe + TraceImmutable,
We trust ourselves to not do anything bad as long as our paramaters don't
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for Wrapping<T> where
T: GcSafe,
[src]
T: GcSafe,
We trust ourselves to not do anything bad as long as our paramaters don't
const NEEDS_DROP: bool
[src]
impl<K: GcSafe + TraceImmutable, V: GcSafe> GcSafe for HashMap<K, V>
[src]
const NEEDS_DROP: bool
[src]
impl<T: GcSafe> GcSafe for Option<T>
[src]
const NEEDS_DROP: bool
[src]
Implementors
impl<T> GcSafe for AssumeNotTraced<T>
[src]
No tracing implies GcSafe
const NEEDS_DROP: bool
[src]
impl<T: GcSafe + Copy> GcSafe for GcCell<T>
[src]
const NEEDS_DROP: bool
[src]
Since T is Copy, we shouldn't need to be dropped
Still delegating just in case