pub type MutableHandleId<'a> = MutableHandle<'a, jsid>;
Aliased Type§
struct MutableHandleId<'a> {
pub(crate) ptr: *mut PropertyKey,
anchor: PhantomData<&'a mut PropertyKey>,
}
Fields§
§ptr: *mut PropertyKey
§anchor: PhantomData<&'a mut PropertyKey>
Implementations
Source§impl<'a, T> MutableHandle<'a, T>
impl<'a, T> MutableHandle<'a, T>
pub unsafe fn from_marked_location(ptr: *mut T) -> Self
pub unsafe fn from_raw(handle: RawMutableHandle<T>) -> Self
pub fn handle(&self) -> Handle<'_, T>
pub(crate) fn new(ptr: &'a mut T) -> Self
pub fn get(&self) -> Twhere
T: Copy,
pub fn set(&mut self, v: T)where
T: Copy,
Sourcepub unsafe fn as_mut<'b>(&'b mut self) -> &'b mut Twhere
'a: 'b,
pub unsafe fn as_mut<'b>(&'b mut self) -> &'b mut Twhere
'a: 'b,
Safety: GC must not run during the lifetime of the returned reference.
Sourcepub fn reborrow<'b>(&'b mut self) -> MutableHandle<'b, T>where
'a: 'b,
pub fn reborrow<'b>(&'b mut self) -> MutableHandle<'b, T>where
'a: 'b,
Creates a copy of this object, with a shorter lifetime, that holds a
mutable borrow on the original object. When you write code that wants
to use a MutableHandle
more than once, you will typically need to
call reborrow
on all but the last usage. The same way that you might
naively clone a type to allow it to be passed to multiple functions.
This is the same thing that happens with regular mutable references, except there the compiler implicitly inserts the reborrow calls. Until rust gains a feature to implicitly reborrow other types, we have to do it by hand.
pub(crate) fn raw(&mut self) -> RawMutableHandle<T>
Trait Implementations
Source§impl<'a, T> Deref for MutableHandle<'a, T>
impl<'a, T> Deref for MutableHandle<'a, T>
Source§impl<'a, T> IntoHandle for MutableHandle<'a, T>
impl<'a, T> IntoHandle for MutableHandle<'a, T>
Source§impl<'a, T> IntoMutableHandle for MutableHandle<'a, T>
impl<'a, T> IntoMutableHandle for MutableHandle<'a, T>
Source§fn into_handle_mut(self) -> RawMutableHandle<T>
fn into_handle_mut(self) -> RawMutableHandle<T>
Convert this object to a mutable handle.