Crates.io | rs2js |
lib.rs | rs2js |
version | 0.2.3 |
source | src |
created_at | 2023-05-02 13:23:50.054246 |
updated_at | 2023-06-13 14:00:23.792852 |
description | A macro to convert Rust structs to/from JsValues |
homepage | |
repository | https://github.com/AmbientRun/Rs2Js |
max_upload_size | |
id | 854554 |
size | 2,784 |
#[derive(Rs2Js, Debug, Clone, PartialEq)]
pub struct DbProject {
pub name: String,
pub owner_id: String,
pub created: Timestamp,
}
fn main() {
let proj = DbProject { .. };
let value = proj.to_js(); // JsValue
}
This mostly exists because serde-wasm-bindgen currently doesn't support passing through JsValues (see this issue).