web_webtransport_sys/gen/
gen_WebTransportSendStreamOptions.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportSendStreamOptions)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `WebTransportSendStreamOptions` dictionary."]
9    pub type WebTransportSendStreamOptions;
10}
11impl WebTransportSendStreamOptions {
12    #[doc = "Construct a new `WebTransportSendStreamOptions`."]
13    pub fn new() -> Self {
14        #[allow(unused_mut)]
15        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
16        ret
17    }
18    #[doc = "Change the `sendGroup` field of this object."]
19    pub fn send_group(&mut self, val: Option<&WebTransportSendGroup>) -> &mut Self {
20        use wasm_bindgen::JsValue;
21        let r = ::js_sys::Reflect::set(
22            self.as_ref(),
23            &JsValue::from("sendGroup"),
24            &JsValue::from(val),
25        );
26        debug_assert!(
27            r.is_ok(),
28            "setting properties should never fail on our dictionary objects"
29        );
30        let _ = r;
31        self
32    }
33    #[doc = "Change the `sendOrder` field of this object."]
34    pub fn send_order(&mut self, val: f64) -> &mut Self {
35        use wasm_bindgen::JsValue;
36        let r = ::js_sys::Reflect::set(
37            self.as_ref(),
38            &JsValue::from("sendOrder"),
39            &JsValue::from(val),
40        );
41        debug_assert!(
42            r.is_ok(),
43            "setting properties should never fail on our dictionary objects"
44        );
45        let _ = r;
46        self
47    }
48    #[doc = "Change the `waitUntilAvailable` field of this object."]
49    pub fn wait_until_available(&mut self, val: bool) -> &mut Self {
50        use wasm_bindgen::JsValue;
51        let r = ::js_sys::Reflect::set(
52            self.as_ref(),
53            &JsValue::from("waitUntilAvailable"),
54            &JsValue::from(val),
55        );
56        debug_assert!(
57            r.is_ok(),
58            "setting properties should never fail on our dictionary objects"
59        );
60        let _ = r;
61        self
62    }
63}
64impl Default for WebTransportSendStreamOptions {
65    fn default() -> Self {
66        Self::new()
67    }
68}