Struct comet::gcref::UntypedGcRef [−][src]
#[repr(C)]pub struct UntypedGcRef { /* fields omitted */ }Expand description
A untyped garbage collected pointer to a value, you can think of it as void* pointer but managed by GC.
This is the equivalent of a garbage collected smart-pointer.
The smart pointer is simply a guarantee to the garbage collector that this points to a garbage collected object with the correct header, and not some arbitrary bits that you’ve decided to heap allocate.
Implementations
Returns data part of GC object. That is part of allocation after heap object header.
Returns true if object has the same index.
pub fn cast<T: GCInfoTrait<T> + TraceTrait + FinalizeTrait<T> + 'static>(
self
) -> Option<GcRef<T>>
pub fn cast<T: GCInfoTrait<T> + TraceTrait + FinalizeTrait<T> + 'static>(
self
) -> Option<GcRef<T>>
Returns Some(T) if T::index() is the same as in this object.
pub unsafe fn cast_unchecked<T: GCInfoTrait<T> + TraceTrait + FinalizeTrait<T> + 'static>(
self
) -> GcRef<T>
pub unsafe fn cast_unchecked<T: GCInfoTrait<T> + TraceTrait + FinalizeTrait<T> + 'static>(
self
) -> GcRef<T>
Unchecked cast withouth verifying indexes.
Trait Implementations
Function invoking the tracing for an object of type T. Read more
trace_ method is used for C FFI safety.
Returns trace descriptor for type that implements this trait. Not recommended to override it.
Auto Trait Implementations
impl RefUnwindSafe for UntypedGcRef
impl !Send for UntypedGcRef
impl !Sync for UntypedGcRef
impl Unpin for UntypedGcRef
impl UnwindSafe for UntypedGcRef
Blanket Implementations
Mutably borrows from an owned value. Read more