worker_plus_sys/
streams.rs1use wasm_bindgen::prelude::*;
2use web_sys::{ReadableStream, WritableStream};
3
4#[wasm_bindgen]
5extern "C" {
6 #[wasm_bindgen(extends=::js_sys::Object, js_name=FixedLengthStream)]
7 #[derive(Debug, Clone)]
8 pub type FixedLengthStream;
9
10 #[wasm_bindgen(constructor, js_class=FixedLengthStream)]
11 pub fn new(length: u32) -> FixedLengthStream;
12
13 #[wasm_bindgen(constructor, js_class=FixedLengthStream)]
14 pub fn new_big_int(length: js_sys::BigInt) -> FixedLengthStream;
15
16 #[wasm_bindgen(structural, method, getter, js_class=FixedLengthStream, js_name=readable)]
17 pub fn readable(this: &FixedLengthStream) -> ReadableStream;
18
19 #[wasm_bindgen(structural, method, getter, js_class=FixedLengthStream, js_name=writable)]
20 pub fn writable(this: &FixedLengthStream) -> WritableStream;
21
22 #[wasm_bindgen(structural, method, getter, js_class=FixedLengthStream, js_name=cron)]
23 pub fn cron(this: &FixedLengthStream) -> String;
24}