Function zerogc::epsilon::gc

source · []
pub const fn gc<'gc, T: ?Sized + GcSafe<'gc, EpsilonCollectorId> + 'gc>(
    ptr: &'gc T
) -> Gc<'gc, T>
Expand description

Coerce a reference into a Gc pointer.

This is only supported on the epsilon collector. Because the epsilon collector never allocates, it doesn’t need to make a distinction between Gc<T> and &T.

This will never actually be collected and will always be valid

TODO: Rename??