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<'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 &[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 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 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, 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 Date

Source§

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

Source§

impl<'cx, B> TryIntoJs<'cx> for ArrayBuffer<B>
where B: AsRef<[u8]>,

Source§

impl<'cx, B> TryIntoJs<'cx> for Buffer<B>
where B: AsRef<[u8]>,

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 BigInt64Array<T>
where T: AsRef<[i64]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for BigUint64Array<T>
where T: AsRef<[u64]>,

Source§

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

Source§

impl<'cx, T> TryIntoJs<'cx> for Float32Array<T>
where T: AsRef<[f32]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Float64Array<T>
where T: AsRef<[f64]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Int8Array<T>
where T: AsRef<[i8]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Int16Array<T>
where T: AsRef<[i16]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Int32Array<T>
where T: AsRef<[i32]>,

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 Uint8Array<T>
where T: AsRef<[u8]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Uint16Array<T>
where T: AsRef<[u16]>,

Source§

impl<'cx, T> TryIntoJs<'cx> for Uint32Array<T>
where T: AsRef<[u32]>,

Source§

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