Type Alias mozjs::jsapi::MutableHandleId

source ·
pub type MutableHandleId = MutableHandle<PropertyKey>;
Expand description

Similar to a handle, but the underlying storage can be changed. This is useful for outparams.

If you want to add additional methods to MutableHandle for a specific specialization, define a MutableHandleOperations specialization containing them.

Aliased Type§

struct MutableHandleId {
    pub ptr: *mut PropertyKey,
    pub _phantom_0: PhantomData<UnsafeCell<PropertyKey>>,
}

Fields§

§ptr: *mut PropertyKey§_phantom_0: PhantomData<UnsafeCell<PropertyKey>>

Implementations§

source§

impl<T> MutableHandle<T>

source

pub unsafe fn from_marked_location(ptr: *mut T) -> MutableHandle<T>

source

pub fn handle(&self) -> Handle<T>

source

pub fn get(&self) -> Twhere T: Copy,

source

pub fn set(&self, v: T)where T: Copy,

Trait Implementations§

source§

impl<T> Clone for MutableHandle<T>where T: Clone,

source§

fn clone(&self) -> MutableHandle<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for MutableHandle<T>where T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Deref for MutableHandle<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref<'a>(&'a self) -> &'a T

Dereferences the value.
source§

impl<T> DerefMut for MutableHandle<T>

source§

fn deref_mut<'a>(&'a mut self) -> &'a mut T

Mutably dereferences the value.
source§

impl<T> From<T> for MutableHandle<<T as IntoHandle>::Target>where T: IntoMutableHandle,

source§

fn from(value: T) -> MutableHandle<<T as IntoHandle>::Target>

Converts to this type from the input type.
source§

impl<T> PartialEq<MutableHandle<T>> for MutableHandle<T>where T: PartialEq<T>,

source§

fn eq(&self, other: &MutableHandle<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Copy for MutableHandle<T>where T: Copy,

source§

impl<T> StructuralPartialEq for MutableHandle<T>