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>