pub struct Handle<T: Trace + ?Sized> { /* private fields */ }
Expand description
Wraps GC heap pointer.
GC thing pointers on the heap must be wrapped in a Handle<T>
Implementations§
Source§impl<T: Trace + Sized> Handle<T>
impl<T: Trace + Sized> Handle<T>
pub fn get(&self) -> &T
Sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Returns mutable reference to rooted value
§Safety
Rust semantics doesn’t allow two mutable references at the same time and this function is safe as long as you have only one mutable reference.
If you want to be 100% sure that you don’t have two or more mutable references at the same time please use Heap<RefCell<T>>
Trait Implementations§
Source§impl<T: Trace + Ord> Ord for Handle<T>
impl<T: Trace + Ord> Ord for Handle<T>
Source§impl<T: Trace + PartialOrd> PartialOrd for Handle<T>
impl<T: Trace + PartialOrd> PartialOrd for Handle<T>
impl<T: Trace> Copy for Handle<T>
impl<T: Trace + Eq> Eq for Handle<T>
Auto Trait Implementations§
impl<T> Freeze for Handle<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Handle<T>where
T: RefUnwindSafe + ?Sized,
impl<T> !Send for Handle<T>
impl<T> !Sync for Handle<T>
impl<T> Unpin for Handle<T>where
T: ?Sized,
impl<T> UnwindSafe for Handle<T>where
T: RefUnwindSafe + ?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