pub struct GcPtr<T> { /* private fields */ }Implementations§
Source§impl<T> GcPtr<T>
impl<T> GcPtr<T>
Sourcepub unsafe fn from_raw(ptr: *const T) -> Self
pub unsafe fn from_raw(ptr: *const T) -> Self
§Safety
ptrmust be non-null and correctly aligned forT.ptrmust point to a valid instance ofTallocated by RunMat’s GC and remain alive for the duration of all uses of the returnedGcPtr.- The caller is responsible for upholding aliasing and lifetime invariants
when this pointer is dereferenced via
Deref/DerefMut.
pub fn null() -> Self
pub fn is_null(&self) -> bool
Sourcepub unsafe fn as_raw(&self) -> *const T
pub unsafe fn as_raw(&self) -> *const T
§Safety
The returned raw pointer may become invalid if the underlying object is collected by the GC. The caller must ensure the object is kept alive (e.g., via rooting) for any dereference, and must respect aliasing and lifetime rules when using the pointer.
Sourcepub unsafe fn as_raw_mut(&self) -> *mut T
pub unsafe fn as_raw_mut(&self) -> *mut T
§Safety
Returns a mutable raw pointer to the underlying object. The caller must ensure exclusive access when mutating through this pointer, that the object outlives all uses, and that aliasing/lifetime invariants are respected. Mutating a collected or shared object is undefined behavior.
Trait Implementations§
impl<T: Copy> Copy for GcPtr<T>
impl<T: Eq> Eq for GcPtr<T>
impl<T: Send> Send for GcPtr<T>
impl<T: Sync> Sync for GcPtr<T>
Auto Trait Implementations§
impl<T> Freeze for GcPtr<T>
impl<T> RefUnwindSafe for GcPtr<T>where
T: RefUnwindSafe,
impl<T> Unpin for GcPtr<T>where
T: Unpin,
impl<T> UnwindSafe for GcPtr<T>where
T: RefUnwindSafe + 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