neon::types

Trait Value

source
pub trait Value: ValueInternal {
    // Provided methods
    fn to_string<'cx, C: Context<'cx>>(
        &self,
        cx: &mut C,
    ) -> JsResult<'cx, JsString> { ... }
    fn as_value<'cx, C: Context<'cx>>(&self, _: &mut C) -> Handle<'cx, JsValue> { ... }
    fn to_raw(&self) -> Value { ... }
    unsafe fn from_raw<'cx, C: Context<'cx>>(
        cx: &C,
        value: Value,
    ) -> Handle<'cx, Self> { ... }
}
Expand description

The trait shared by all JavaScript values.

Provided Methods§

source

fn to_string<'cx, C: Context<'cx>>(&self, cx: &mut C) -> JsResult<'cx, JsString>

source

fn as_value<'cx, C: Context<'cx>>(&self, _: &mut C) -> Handle<'cx, JsValue>

source

fn to_raw(&self) -> Value

Available on crate feature sys only.

Get a raw reference to the wrapped Node-API value.

source

unsafe fn from_raw<'cx, C: Context<'cx>>( cx: &C, value: Value, ) -> Handle<'cx, Self>

Available on crate feature sys only.

Creates a value from a raw Node-API value.

§Safety
  • value must be of type Self
  • value must be valid for 'cx

Object Safety§

This trait is not object safe.

Implementors§