node_sys/interface/
writable_stream.rs

1use crate::class::EventEmitter;
2use js_sys::{Function, JsString, Uint8Array};
3use wasm_bindgen::prelude::*;
4
5#[wasm_bindgen]
6extern {
7    #[wasm_bindgen(extends = EventEmitter)]
8    #[derive(Clone, Debug)]
9    pub type WritableStream;
10
11    //******************//
12    // Instance Methods //
13    //******************//
14
15    #[wasm_bindgen(method)]
16    fn end(this: &WritableStream, cb: Option<&Function>);
17
18    #[wasm_bindgen(method, js_name = "end")]
19    fn end_with_data(this: &WritableStream, buffer: &Uint8Array, cb: Option<&Function>);
20
21    #[wasm_bindgen(method, js_name = "end")]
22    fn end_with_string(this: &WritableStream, string: &JsString, encoding: Option<&JsString>, cb: Option<&Function>);
23
24    #[wasm_bindgen(method)]
25    fn write_with_data(this: &WritableStream, buffer: &Uint8Array, cb: Option<&Function>) -> bool;
26
27    #[wasm_bindgen(method)]
28    fn write_with_string(
29        this: &WritableStream,
30        string: &JsString,
31        encoding: Option<&JsString>,
32        cb: Option<&Function>,
33    ) -> bool;
34
35    //*********************//
36    // Instance Properties //
37    //*********************//
38
39    #[wasm_bindgen(method, getter)]
40    fn writeable(this: &WritableStream) -> bool;
41}