/
View dependency graph
Depends on
- debhelper (debhelper)
- dh-cargo (dh-cargo)
- rust-proc-macro2 (librust-proc-macro2-1+default-dev)
- rust-quote (librust-quote-1+default-dev)
- rust-serde-derive (librust-serde-derive-1+default-dev)
- cargo, librust-serde-1+default-dev, librust-syn-1+derive-dev, librust-syn-1+parsing-dev, librust-syn-1+printing-dev, libstd-rust-dev, rustc
README (full)
Derive macros for the stdweb crate
This crate currently defines a derive macro for stdweb
which allows you to define custom reference types outside
of stdweb.
For example:
#[derive(Clone, Debug, PartialEq, Eq, ReferenceType)]
#[reference(instance_of = "Error")]
pub struct Error( Reference );
#[derive(Clone, Debug, PartialEq, Eq, ReferenceType)]
#[reference(instance_of = "TypeError")]
#[reference(subclass_of(Error))]
pub struct TypeError( Reference );
And then you can do:
// You can use `try_into` to cast a `Value` to your type.
let error: TypeError = js!( return new TypeError(); ).try_into().unwrap();
// You can also pass your type freely into the `js!` macro:
js!( console.log( @{error} ); );
| dir | debian/ |
| dir | src/ |
| file | .cargo_vcs_info.json |
| file | Cargo.toml |
| file | Cargo.toml.orig |
| file | README.md |