#[repr(C)]pub struct GcRef<T> { /* private fields */ }
Expand description
A typed garbage collected pointer to a value.
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§
Source§impl<T> GcRef<T>
impl<T> GcRef<T>
pub fn into_raw(self) -> *const HeapObjectHeader
pub fn downcast(self) -> UntypedGcRef
Trait Implementations§
Source§impl<T> TraceTrait for GcRef<T>where
T: TraceTrait,
impl<T> TraceTrait for GcRef<T>where
T: TraceTrait,
Source§fn trace(&self, vis: &mut Visitor)
fn trace(&self, vis: &mut Visitor)
Function invoking the tracing for an object of type
T
. Read moreSource§extern "C" fn trace_(vis: *mut Visitor, this: *const u8)
extern "C" fn trace_(vis: *mut Visitor, this: *const u8)
trace_
method is used for C FFI safety.Source§fn get_trace_descriptor(this: *const u8) -> TraceDescriptor
fn get_trace_descriptor(this: *const u8) -> TraceDescriptor
Returns trace descriptor for type that implements this trait. Not recommended to override it.
impl<T> Copy for GcRef<T>
impl<T> Eq for GcRef<T>
Auto Trait Implementations§
impl<T> Freeze for GcRef<T>
impl<T> RefUnwindSafe for GcRef<T>where
T: RefUnwindSafe,
impl<T> !Send for GcRef<T>
impl<T> !Sync for GcRef<T>
impl<T> Unpin for GcRef<T>where
T: Unpin,
impl<T> UnwindSafe for GcRef<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more