chiark / gitweb /
Initial wasm crate
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Oct 2020 16:09:17 +0000 (17:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Oct 2020 16:09:24 +0000 (17:09 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cargo.lock.example
Cargo.toml
wasm/Cargo.toml [new file with mode: 0644]
wasm/wasm.rs [new file with mode: 0644]

index 68c3ba557e97ec8948be3ccd93cd8825709f3bb8..ad78b5a62c8627aab19efad4656ef326b7d6b765 100644 (file)
@@ -186,6 +186,12 @@ dependencies = [
  "byte-tools",
 ]
 
+[[package]]
+name = "bumpalo"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
+
 [[package]]
 name = "bundle-sources"
 version = "0.1.0"
@@ -1117,6 +1123,14 @@ dependencies = [
  "vecdeque-stableix",
 ]
 
+[[package]]
+name = "otter-wasm"
+version = "0.0.1"
+dependencies = [
+ "otter-zcoord",
+ "wasm-bindgen",
+]
+
 [[package]]
 name = "otter-zcoord"
 version = "0.0.1"
@@ -2184,6 +2198,60 @@ version = "0.10.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
 
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68"
+dependencies = [
+ "bumpalo",
+ "lazy_static",
+ "log 0.4.11",
+ "proc-macro2 1.0.24",
+ "quote 1.0.7",
+ "syn 1.0.43",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038"
+dependencies = [
+ "quote 1.0.7",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
+dependencies = [
+ "proc-macro2 1.0.24",
+ "quote 1.0.7",
+ "syn 1.0.43",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307"
+
 [[package]]
 name = "winapi"
 version = "0.2.8"
index 0ce65fa56b22fb540e7486fc6186a75add50be4d..ba01bda7c061a5df59eccc5e7660f4464ce897c2 100644 (file)
@@ -11,6 +11,7 @@ version = "0.0.1"
 edition = "2018"
 
 [workspace]
+members = ["wasm"]
 
 [dependencies]
 #lazy_static = "1.0.0"
diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml
new file mode 100644 (file)
index 0000000..715c03c
--- /dev/null
@@ -0,0 +1,17 @@
+
+[package]
+name = "otter-wasm"
+authors = ["Ian Jackson <ijackson@chiark.greenend.org.uk>"]
+license = "AGPL-3.0-or-later"
+
+version = "0.0.1"
+edition = "2018"
+
+[lib]
+name = "otter_wasm"
+path = "wasm.rs"
+crate-type = ["cdylib"]
+
+[dependencies]
+otter-zcoord = { path = "../zcoord" }
+wasm-bindgen = "0.2"
diff --git a/wasm/wasm.rs b/wasm/wasm.rs
new file mode 100644 (file)
index 0000000..d6c22dc
--- /dev/null
@@ -0,0 +1,5 @@
+
+use wasm_bindgen::prelude::*;
+
+#[wasm_bindgen]
+pub struct ZCoordIterator (zcoord::Mutable);