e.g.
let (mut send, mut recv) = connection
.open_bi()
.await
.map_err(convert_error)?
.wait_bi()
.await?;
send.write(b"test").await.map_err(convert_error)?;
let mut buf = [0; 8];
let amount = tokio::io::AsyncReadExt::read(&mut recv, &mut buf).await?;
let value = &buf[..amount];
TypeError: Failed to execute 'read' on 'ReadableStreamBYOBReader': parameter 1 is not of type 'ArrayBufferView'.
at imports.wbg.__wbg_read_421ea09231f62999 (client.js:342:37)
at web_sys::features::gen_ReadableStreamByobReader::ReadableStreamByobReader::read_with_array_buffer_view::h2d79409db104f874 (client_bg.wasm:0x192cf)
at <web_sys_async_io::reader::Reader as tokio::io::async_read::AsyncRead>::poll_read::hc90cb112c785b849 (client_bg.wasm:0xc563)
at <xwt_web_sys::RecvStream as tokio::io::async_read::AsyncRead>::poll_read::hfc44f7b8815e8db5 (client_bg.wasm:0x19294)
at client::main::{{closure}}::haf584d15d6c74303 (client_bg.wasm:0x2561)
at wasm_bindgen_futures::task::singlethread::Task::run::h0ab3b9ff943bdb36 (client_bg.wasm:0x15030)
at wasm_bindgen_futures::queue::Queue::new::{{closure}}::h592219bb7764a2c3 (client_bg.wasm:0xf5c1)
at wasm_bindgen::convert::closures::invoke1_mut::h00413c1a66bb61c2 (client_bg.wasm:0x18bc7)
at __wbg_adapter_22 (client.js:208:10)
at real (client.js:193:20)