react-rs 1.0.0-alpha.8

react runtime for frender
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::any::Any;
use wasm_bindgen::JsValue;

pub struct PassedToJsRuntime {
    pub js_value: JsValue,
    pub to_persist: Option<Box<dyn Any>>,
}

pub trait SafeIntoJsRuntime: Sized {
    fn safe_into_js_runtime(self) -> PassedToJsRuntime;
}

impl<T: SafeIntoJsRuntime> SafeIntoJsRuntime for Box<T> {
    fn safe_into_js_runtime(self) -> PassedToJsRuntime {
        (*self).safe_into_js_runtime()
    }
}