Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
60 views

Rust WASM memory ptr is not same as JS Arraybuffer offset

I try to pass json content from js to rust with zero copy, but is seems the memory where rust vec ptr point to is not same as js arraybuffer with offset. My Env: cargo 1.83.0 wasm-pack 0.13.1 wasm-...
NightmareRevisited's user avatar
2 votes
0 answers
80 views

What is the cleanest way to re-implement Rust's BufRead, Read, and Seek traits for WASM?

I am working on a VScode extension, which uses a combination of Typescript and WebAssembly for file parsing and data handling. The parser is written in rust and compiled to WASM, as this is faster and ...
user28169578's user avatar
2 votes
1 answer
157 views

Rust WASM code stalls on awaiting web_sys::Window.fetch_with_request

I am trying to use the Fetch API using web_sys in Rust WASM code. I have defined an async function: #[wasm_bindgen] pub async fn fetch_as_vec_u8(resource_name: &str) -> Result<Vec<u8>, ...
Vasili Korol's user avatar
0 votes
1 answer
95 views

How can I return a tuple to javascript from wasm where elements have non Copy/Clone traits?

I have a problem where I need to return a tuple from a wasm function as the following: #[wasm_bindgen] pub fn channel() -> (futures::channel::mpsc::Sender<i32>, futures::channel::mpsc::...
Kevin's user avatar
  • 3,378
3 votes
1 answer
83 views

How to use string slices in Rust targeting WebAssembly

I've developped a library in Rust to parse RTF content. I've initially targeted x86 architectures. So I have use lots of string slices (&str) to reference to the original source without copying ...
Dorian B's user avatar
  • 170
0 votes
1 answer
143 views

Does WASM Bindgen copy &mut [u8] zero times or twice?

From JavaScript, I call this Rust function. Does Bindgen copy the memory twice or zero times? #[wasm_bindgen] pub fn mod_u8_slice(input_output: &mut [u8]) { input_output.iter_mut().for_each(|x|...
Carl's user avatar
  • 383
2 votes
0 answers
95 views

After 'cargo install wasm-pack' do I need to manually update chrome & chromedriver?

I'm on Windows 11. When I cargo install wasm-pack it installs chromedriver v 114, but v 114 doesn't work with the current version of Chrome. I want to be able to run tests via wasm-pack test --chrome -...
Carl's user avatar
  • 383
3 votes
1 answer
1k views

How you can link a Rust library with C/C++ and wasm-bindgen for the wasm32-unknown-unknown target?

Title. What are the specific steps to compile and link C/C++ and Rust under the same WASM binary for wasm32-unknown-unknown while using wasm-bindgen? Context wasm32-unknown-emscripten is a legacy ...
Rafael Beckel's user avatar
1 vote
1 answer
149 views

Compiling rust with webback for webassembly

The error occurs when i use opencascade = "0.2.0" dependency. following is my Cargo.toml [package] name = "wasm-demo" version = "0.1.0" authors = ["Ravi"] ...
Ravi Belkhindi's user avatar
0 votes
0 answers
141 views

How can I make a simple requestAnimationFrame loop in Rust with arguments?

I am trying to make a requestAnimationFrame loop in Rust with arguments. I've looked and found how to make a requestAnimationFrame loop like so: fn loop() { // do stuff here let closure = ...
CodingMaster239's user avatar
0 votes
1 answer
194 views

Read an array of bools from wasm memory

I'm trying to read an array of boolean values directly from wasm memory, but I can't figure out how I can read the array from JavaScript. The code that I'm trying to bind to JavaScript is similar to ...
B. Sebastiano's user avatar
1 vote
0 answers
331 views

Build a wasm module from Rust to be used as a plugin for a Rust process reading it with Wasmer

I have a Rust project that wants to consume plugins distributed as wasm modules. The guides I see online are largely for running building/running wasm modules on the web and not exactly my use case. I ...
David Alsh's user avatar
  • 7,731
0 votes
1 answer
1k views

Achieve multi threading in WASM for making http requests (using reqwest crate)

I am trying to convert current implementation to WASM (for cloudflare workers). But I have been facing problem with current implementation is that it uses multi threading to make requests, but I am ...
Sandip's user avatar
  • 206
0 votes
0 answers
101 views

How can I implement a rust constructor compiled to wasm that will allow for javascript destructuring? [duplicate]

I'm using rust-wasm, wasm-bindgen, to create a javascript wrapper for a rust library. I have a rust constructor currently defined like #[wasm_bindgen(js_class = Dater)] impl DaterWrapper { #[...
daidoji70's user avatar
  • 352
1 vote
1 answer
472 views

Write rust app that allows sandboxed plugins written in .. rust? [closed]

I want to write an app in rust that is extensible with plugins written by (untrusted) users. Those plugins are downloadable via a web platform and can be installed by any user of the core software, ...
glades's user avatar
  • 5,028

15 30 50 per page
1
2 3 4 5
9