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

#[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, K: Value> PropertyKey for Handle<'a, K>
[src]

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

This method tests for !=.

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

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

Performs copy-assignment from source. Read more

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

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

The resulting type after dereferencing.

impl<'a, T: Managed> DerefMut for Handle<'a, T>
[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

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]