0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-21 15:04:33 -05:00

Add cppgc::InnerMember::get_mut (#1505)

This commit is contained in:
Divy Srivastava 2024-06-22 08:28:31 -07:00 committed by GitHub
parent 425862adbc
commit a0dc5c1893
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -226,6 +226,10 @@ impl InnerMember {
pub unsafe fn get<T: GarbageCollected>(&self) -> &T {
unsafe { self.ptr.cast::<T>().as_ref().unwrap() }
}
pub unsafe fn get_mut<T: GarbageCollected>(&mut self) -> &mut T {
unsafe { self.ptr.cast::<T>().as_mut().unwrap() }
}
}
/// Members are used to contain strong pointers to other garbage