pub struct GcPointer<T: GcCell + ?Sized> { /* private fields */ }
Expand description
GC collected smart-pointer. It allows T
to be ?Sized
for dynamic casts.
Implementations§
Source§impl<T: GcCell + ?Sized> GcPointer<T>
impl<T: GcCell + ?Sized> GcPointer<T>
Sourcepub fn untyped(self) -> UntypedGcRef
pub fn untyped(self) -> UntypedGcRef
Returns untyped GC ref from this pointer.
Sourcepub fn is<U: Trace + Finalize<U> + GcCell + GCInfoTrait<U>>(self) -> bool
pub fn is<U: Trace + Finalize<U> + GcCell + GCInfoTrait<U>>(self) -> bool
Check if this GC pointer stores U
.
Sourcepub fn get_dyn_mut(&mut self) -> &mut dyn GcCell
pub fn get_dyn_mut(&mut self) -> &mut dyn GcCell
Get mutable reference to dyn GcCell
Sourcepub unsafe fn downcast_unchecked<U: GcCell>(self) -> GcPointer<U>
pub unsafe fn downcast_unchecked<U: GcCell>(self) -> GcPointer<U>
Unchecked downcast to U
.
Trait Implementations§
Source§impl<T: GcCell + Trace> TraceTrait for GcPointer<T>
impl<T: GcCell + Trace> TraceTrait for GcPointer<T>
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: GcCell + ?Sized> Copy for GcPointer<T>
impl<T: GcCell> Eq for GcPointer<T>
Auto Trait Implementations§
impl<T> Freeze for GcPointer<T>where
T: ?Sized,
impl<T> RefUnwindSafe for GcPointer<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Send for GcPointer<T>
impl<T> !Sync for GcPointer<T>
impl<T> Unpin for GcPointer<T>
impl<T> UnwindSafe for GcPointer<T>where
T: UnwindSafe + ?Sized,
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