Struct neon::handle::Handle[][src]

#[repr(C)]
pub struct Handle<'a, T: Managed + 'a> { /* fields omitted */ }

A safely rooted handle to a JS value in memory that is managed by the garbage collector.

Methods

impl<'a, T: Value> Handle<'a, T>
[src]

Safely upcast a handle to a supertype.

This method does not require an execution context because it only copies a handle.

Tests whether this value is an instance of the given type.

Example:

let v: Handle<JsValue> = cx.number(17).upcast();
v.is_a::<JsString>(); // false
v.is_a::<JsNumber>(); // true
v.is_a::<JsValue>();  // true

Attempts to downcast a handle to another type, which may fail. A failure to downcast does not throw a JavaScript exception, so it's OK to continue interacting with the JS engine if this method produces an Err result.

Attempts to downcast a handle to another type, raising a JavaScript TypeError exception on failure. This method is a convenient shorthand, equivalent to self.downcast::<U>().or_throw::<C>(cx).

Trait Implementations

impl<'a, T: Clone + Managed + 'a> Clone for Handle<'a, T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, T: Copy + Managed + 'a> Copy for Handle<'a, T>
[src]

impl<'a, T: Managed + 'a> PartialEq for Handle<'a, T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a, T: Managed + 'a> Eq for Handle<'a, T>
[src]

impl<'a, T: Managed> Deref for Handle<'a, T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<'a, T: Managed> DerefMut for Handle<'a, T>
[src]

Mutably dereferences the value.

impl<'a, K: Value> PropertyKey for Handle<'a, K>
[src]

Auto Trait Implementations

impl<'a, T> Send for Handle<'a, T> where
    T: Send + Sync

impl<'a, T> Sync for Handle<'a, T> where
    T: Sync