neon::types::extract

Trait TryIntoJs

Source
pub trait TryIntoJs<'cx>
where Self: Sealed,
{ type Value: Value; // Required method fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>; }
Expand description

Convert Rust data into a JavaScript value

Required Associated Types§

Source

type Value: Value

The type of JavaScript value that will be created

Required Methods§

Source

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Convert self into a JavaScript value

Implementations on Foreign Types§

Source§

impl<'a, 'cx> TryIntoJs<'cx> for &'a str

Source§

type Value = JsString

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'a, 'cx> TryIntoJs<'cx> for &'a String

Source§

type Value = JsString

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'a, 'cx, T> TryIntoJs<'cx> for &'a [T]
where JsTypedArray<T>: Value, T: Binary,

Source§

type Value = JsTypedArray<T>

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'a, 'cx, T> TryIntoJs<'cx> for &'a Vec<T>
where JsTypedArray<T>: Value, T: Binary,

Source§

type Value = JsTypedArray<T>

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for Infallible

Source§

type Value = JsValue

Source§

fn try_into_js(self, _: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for bool

Source§

type Value = JsBoolean

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for f32

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for f64

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for i8

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for i16

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for i32

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for u8

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for u16

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for u32

Source§

type Value = JsNumber

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for ()

Source§

type Value = JsUndefined

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx> TryIntoJs<'cx> for String

Source§

type Value = JsString

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, L, R> TryIntoJs<'cx> for Either<L, R>
where L: TryIntoJs<'cx>, R: TryIntoJs<'cx>,

Source§

type Value = JsValue

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T> TryIntoJs<'cx> for Option<T>
where T: TryIntoJs<'cx>,

Source§

type Value = JsValue

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T> TryIntoJs<'cx> for Box<[T]>
where JsTypedArray<T>: Value, T: Binary,

Source§

type Value = JsTypedArray<T>

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T> TryIntoJs<'cx> for Box<T>
where T: TryIntoJs<'cx>,

Source§

type Value = <T as TryIntoJs<'cx>>::Value

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T> TryIntoJs<'cx> for Vec<T>
where JsTypedArray<T>: Value, T: Binary,

Source§

type Value = JsTypedArray<T>

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T, E> TryIntoJs<'cx> for Result<T, E>
where T: TryIntoJs<'cx>, E: TryIntoJs<'cx>,

Source§

type Value = <T as TryIntoJs<'cx>>::Value

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T, V> TryIntoJs<'cx> for Arc<T>
where for<'a> &'a T: TryIntoJs<'cx, Value = V>, V: Value,

Source§

type Value = V

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Source§

impl<'cx, T, const N: usize> TryIntoJs<'cx> for [T; N]
where JsTypedArray<T>: Value, T: Binary,

Source§

type Value = JsTypedArray<T>

Source§

fn try_into_js(self, cx: &mut Cx<'cx>) -> JsResult<'cx, Self::Value>

Implementors§

Source§

impl<'cx> TryIntoJs<'cx> for Throw

Source§

impl<'cx> TryIntoJs<'cx> for neon::types::extract::json::Error

Available on crate feature serde only.
Source§

impl<'cx> TryIntoJs<'cx> for ArrayBuffer

Source§

impl<'cx> TryIntoJs<'cx> for Buffer

Source§

impl<'cx> TryIntoJs<'cx> for Date

Source§

impl<'cx> TryIntoJs<'cx> for neon::types::extract::Error

Source§

impl<'cx, F, O> TryIntoJs<'cx> for With<F, O>
where F: FnOnce(&mut Cx<'_>) -> O, O: TryIntoJs<'cx>,

Source§

type Value = <O as TryIntoJs<'cx>>::Value

Source§

impl<'cx, O> TryIntoJs<'cx> for Root<O>
where O: Object,

Source§

type Value = O

Source§

impl<'cx, T> TryIntoJs<'cx> for Handle<'cx, T>
where T: Value,

Source§

type Value = T

Source§

impl<'cx, T> TryIntoJs<'cx> for Json<T>
where T: Serialize,

Available on crate feature serde only.
Source§

impl<'cx, T> TryIntoJs<'cx> for Boxed<T>
where T: Finalize + 'static,

Source§

impl<'cx, T: Value> TryIntoJs<'cx> for TypeExpected<T>