[][src]Trait zerogc::GcSafe

pub unsafe trait GcSafe: Trace {
    pub 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

pub 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()

Loading content...

Implementations on Foreign Types

impl GcSafe for i8[src]

No drop/custom behavior -> GcSafe

impl GcSafe for i16[src]

No drop/custom behavior -> GcSafe

impl GcSafe for i32[src]

No drop/custom behavior -> GcSafe

impl GcSafe for i64[src]

No drop/custom behavior -> GcSafe

impl GcSafe for isize[src]

No drop/custom behavior -> GcSafe

impl GcSafe for u8[src]

No drop/custom behavior -> GcSafe

impl GcSafe for u16[src]

No drop/custom behavior -> GcSafe

impl GcSafe for u32[src]

No drop/custom behavior -> GcSafe

impl GcSafe for u64[src]

No drop/custom behavior -> GcSafe

impl GcSafe for usize[src]

No drop/custom behavior -> GcSafe

impl GcSafe for f32[src]

No drop/custom behavior -> GcSafe

impl GcSafe for f64[src]

No drop/custom behavior -> GcSafe

impl GcSafe for ()[src]

impl<A: GcSafe> GcSafe for (A,)[src]

impl<A: GcSafe, B: GcSafe> GcSafe for (A, B)[src]

impl<A: GcSafe, B: GcSafe, C: GcSafe> GcSafe for (A, B, C)[src]

impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe> GcSafe for (A, B, C, D)[src]

impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe> GcSafe for (A, B, C, D, E)[src]

impl<A: GcSafe, B: GcSafe, C: GcSafe, D: GcSafe, E: GcSafe, F: GcSafe> GcSafe for (A, B, C, D, E, F)[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]

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]

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]

impl<T: GcSafe> GcSafe for [T; 0][src]

impl<T: GcSafe> GcSafe for [T; 1][src]

impl<T: GcSafe> GcSafe for [T; 2][src]

impl<T: GcSafe> GcSafe for [T; 3][src]

impl<T: GcSafe> GcSafe for [T; 4][src]

impl<T: GcSafe> GcSafe for [T; 5][src]

impl<T: GcSafe> GcSafe for [T; 6][src]

impl<T: GcSafe> GcSafe for [T; 7][src]

impl<T: GcSafe> GcSafe for [T; 8][src]

impl<T: GcSafe> GcSafe for [T; 9][src]

impl<T: GcSafe> GcSafe for [T; 10][src]

impl<T: GcSafe> GcSafe for [T; 11][src]

impl<T: GcSafe> GcSafe for [T; 12][src]

impl<T: GcSafe> GcSafe for [T; 13][src]

impl<T: GcSafe> GcSafe for [T; 14][src]

impl<T: GcSafe> GcSafe for [T; 15][src]

impl<T: GcSafe> GcSafe for [T; 16][src]

impl<T: GcSafe> GcSafe for [T; 17][src]

impl<T: GcSafe> GcSafe for [T; 18][src]

impl<T: GcSafe> GcSafe for [T; 19][src]

impl<T: GcSafe> GcSafe for [T; 20][src]

impl<T: GcSafe> GcSafe for [T; 24][src]

impl<T: GcSafe> GcSafe for [T; 32][src]

impl<T: GcSafe> GcSafe for [T; 48][src]

impl<T: GcSafe> GcSafe for [T; 64][src]

impl<T: GcSafe> GcSafe for [T; 100][src]

impl<T: GcSafe> GcSafe for [T; 128][src]

impl<T: GcSafe> GcSafe for [T; 256][src]

impl<T: GcSafe> GcSafe for [T; 512][src]

impl<T: GcSafe> GcSafe for [T; 1024][src]

impl<T: GcSafe> GcSafe for [T; 2048][src]

impl<T: GcSafe> GcSafe for [T; 4096][src]

impl<'a, T: GcSafe + TraceImmutable> GcSafe for &'a T[src]

impl<'a, T: GcSafe> GcSafe for &'a mut T[src]

impl<T: GcSafe> GcSafe for [T][src]

impl<T: GcSafe> GcSafe for Option<T>[src]

impl<T> GcSafe for Wrapping<T> where
    T: GcSafe
[src]

We trust ourselves to not do anything bad as long as our paramaters don't

impl<T> GcSafe for Vec<T> where
    T: GcSafe
[src]

We trust ourselves to not do anything bad as long as our paramaters don't

impl<T> GcSafe for Box<T> where
    T: GcSafe
[src]

We trust ourselves to not do anything bad as long as our paramaters don't

impl<T> GcSafe for Rc<T> where
    T: GcSafe + TraceImmutable
[src]

We trust ourselves to not do anything bad as long as our paramaters don't

impl<T> GcSafe for Arc<T> where
    T: GcSafe + TraceImmutable
[src]

We trust ourselves to not do anything bad as long as our paramaters don't

impl GcSafe for String[src]

No drop/custom behavior -> GcSafe

impl<K: GcSafe + TraceImmutable, V: GcSafe> GcSafe for HashMap<K, V>[src]

Loading content...

Implementors

impl<'gc, T: GcSafe + 'gc, Id: CollectorId> GcSafe for Gc<'gc, T, Id>[src]

Double-indirection is completely safe

impl<T> GcSafe for AssumeNotTraced<T>[src]

No tracing implies GcSafe

impl<T: GcSafe + Copy> GcSafe for GcCell<T>[src]

pub const NEEDS_DROP: bool[src]

Since T is Copy, we shouldn't need to be dropped

Loading content...