Trait zerogc::GcSafe [−][src]
pub unsafe trait GcSafe: Trace { const NEEDS_DROP: bool; }
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
[src]
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<T> GcSafe for PhantomData<T>
[src]
impl<T> GcSafe for PhantomData<T>
[src]const NEEDS_DROP: bool
[src]
impl<H, I> GcSafe for (H, I) where
H: GcSafe,
I: GcSafe,
H: Trace,
I: Trace,
[src]
impl<H, I> GcSafe for (H, I) where
H: GcSafe,
I: GcSafe,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<G, H, I> GcSafe for (G, H, I) where
G: GcSafe,
H: GcSafe,
I: GcSafe,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<G, H, I> GcSafe for (G, H, I) where
G: GcSafe,
H: GcSafe,
I: GcSafe,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<F, G, H, I> GcSafe for (F, G, H, I) where
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<F, G, H, I> GcSafe for (F, G, H, I) where
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<E, F, G, H, I> GcSafe for (E, F, G, H, I) where
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<E, F, G, H, I> GcSafe for (E, F, G, H, I) where
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<D, E, F, G, H, I> GcSafe for (D, E, F, G, H, I) where
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<D, E, F, G, H, I> GcSafe for (D, E, F, G, H, I) where
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<C, D, E, F, G, H, I> GcSafe for (C, D, E, F, G, H, I) where
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<C, D, E, F, G, H, I> GcSafe for (C, D, E, F, G, H, I) where
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<B, C, D, E, F, G, H, I> GcSafe for (B, C, D, E, F, G, H, I) where
B: GcSafe,
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
B: Trace,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<B, C, D, E, F, G, H, I> GcSafe for (B, C, D, E, F, G, H, I) where
B: GcSafe,
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
B: Trace,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<A, B, C, D, E, F, G, H, I> GcSafe for (A, B, C, D, E, F, G, H, I) where
A: GcSafe,
B: GcSafe,
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
A: Trace,
B: Trace,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]
impl<A, B, C, D, E, F, G, H, I> GcSafe for (A, B, C, D, E, F, G, H, I) where
A: GcSafe,
B: GcSafe,
C: GcSafe,
D: GcSafe,
E: GcSafe,
F: GcSafe,
G: GcSafe,
H: GcSafe,
I: GcSafe,
A: Trace,
B: Trace,
C: Trace,
D: Trace,
E: Trace,
F: Trace,
G: Trace,
H: Trace,
I: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<'a, T: 'a> GcSafe for &'a T where
T: GcSafe,
T: TraceImmutable,
[src]
impl<'a, T: 'a> GcSafe for &'a T where
T: GcSafe,
T: TraceImmutable,
[src]const NEEDS_DROP: bool
[src]
impl<T: TraceImmutable> GcSafe for Rc<T> where
T: GcSafe,
T: Trace,
[src]
impl<T: TraceImmutable> GcSafe for Rc<T> where
T: GcSafe,
T: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<T: TraceImmutable> GcSafe for Arc<T> where
T: GcSafe,
T: Trace,
[src]
impl<T: TraceImmutable> GcSafe for Arc<T> where
T: GcSafe,
T: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<K: TraceImmutable, V> GcSafe for HashMap<K, V> where
K: GcSafe,
V: GcSafe,
K: Trace,
V: Trace,
[src]
impl<K: TraceImmutable, V> GcSafe for HashMap<K, V> where
K: GcSafe,
V: GcSafe,
K: Trace,
V: Trace,
[src]const NEEDS_DROP: bool
[src]
impl<T: TraceImmutable> GcSafe for HashSet<T> where
T: GcSafe,
T: Trace,
[src]
impl<T: TraceImmutable> GcSafe for HashSet<T> where
T: GcSafe,
T: Trace,
[src]const NEEDS_DROP: bool
[src]
Implementors
impl<'gc, T: GcSafe + 'gc, Id: CollectorId> GcSafe for Gc<'gc, T, Id>
[src]
impl<'gc, T: GcSafe + 'gc, Id: CollectorId> GcSafe for Gc<'gc, T, Id>
[src]Double-indirection is completely safe
const NEEDS_DROP: bool
[src]
impl<T> GcSafe for AssumeNotTraced<T>
[src]
impl<T> GcSafe for AssumeNotTraced<T>
[src]