Skip to main content

AsHandleValue

Trait AsHandleValue 

Source
pub trait AsHandleValue<'a> {
    // Required method
    fn as_handle_value(&'a self) -> HandleValue<'a>;
}
Expand description

Converts a rooted Heap<Value> into a HandleValue.

This is only safe if the Heap is rooted (e.g., held inside a Dom-managed struct), and the #[must_root] crown lint is active to enforce rooting at compile time. Avoids repeating unsafe from_raw calls at each usage site.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> AsHandleValue<'a> for Heap<Value>

Implementors§