TryIntoJs

Trait TryIntoJs 

Source
pub trait TryIntoJs: Sized {
    // Required method
    fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>;
}
Expand description

This trait adds a conversions from a Rust Type into JsValue.

Required Methods§

Source

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

This function tries to convert a Self into JsValue.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TryIntoJs for &str

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for bool

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for f32

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for f64

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for i8

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for i16

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for i32

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for i64

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for i128

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for isize

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for u8

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for u16

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for u32

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for u64

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for u128

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for ()

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for usize

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl TryIntoJs for String

Source§

fn try_into_js(&self, _context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A> TryIntoJs for (A,)
where A: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B> TryIntoJs for (A, B)
where A: TryIntoJs, B: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C> TryIntoJs for (A, B, C)
where A: TryIntoJs, B: TryIntoJs, C: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D> TryIntoJs for (A, B, C, D)
where A: TryIntoJs, B: TryIntoJs, C: TryIntoJs, D: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E> TryIntoJs for (A, B, C, D, E)
where A: TryIntoJs, B: TryIntoJs, C: TryIntoJs, D: TryIntoJs, E: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F> TryIntoJs for (A, B, C, D, E, F)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F, G> TryIntoJs for (A, B, C, D, E, F, G)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F, G, H> TryIntoJs for (A, B, C, D, E, F, G, H)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F, G, H, I> TryIntoJs for (A, B, C, D, E, F, G, H, I)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F, G, H, I, J> TryIntoJs for (A, B, C, D, E, F, G, H, I, J)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K> TryIntoJs for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<K, V, S> TryIntoJs for HashMap<K, V, S>
where K: TryIntoJs, V: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

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

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<T> TryIntoJs for Vec<T>
where T: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Source§

impl<T, S> TryIntoJs for HashSet<T, S>
where T: TryIntoJs,

Source§

fn try_into_js(&self, context: &mut Context) -> Result<JsValue, JsError>

Implementors§