1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! [`WebTransportError`]
//!
//! <https://w3c.github.io/webtransport/#web-transport-error-interface>
use js_sys::Object;
use wasm_bindgen::prelude::*;
use web_sys::DomException;
use super::*;
#[wasm_bindgen]
extern "C" {
///The `WebTransportError` interface.
///
/// <https://w3c.github.io/webtransport/#webtransporterror>
#[wasm_bindgen(extends = DomException, extends = Object)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub type WebTransportError;
/// ```webidl
/// constructor(optional DOMString message = "", optional WebTransportErrorOptions options = {});
/// ```
///
/// <https://w3c.github.io/webtransport/#dom-webtransporterror-webtransporterror>
#[wasm_bindgen(constructor)]
pub fn new() -> WebTransportError;
/// Create an error that carries the given options.
///
/// Both Chrome 154 and Firefox 154 implement the earlier revision of
/// the constructor, which takes the options as its only argument under
/// the `WebTransportErrorInit` name:
///
/// ```webidl
/// constructor(optional WebTransportErrorInit init = {});
/// ```
///
/// Calling them with the message and the options as two arguments - as
/// the current spec defines - throws a `TypeError`, so this is the only
/// way to construct an error with a `streamErrorCode` today.
///
/// <https://w3c.github.io/webtransport/#dom-webtransporterror-webtransporterror>
#[wasm_bindgen(constructor)]
pub fn new_with_init(init: &WebTransportErrorOptions) -> WebTransportError;
/// ```webidl
/// readonly attribute WebTransportErrorSource source;
/// ```
///
/// <https://w3c.github.io/webtransport/#dom-webtransporterror-source>
#[wasm_bindgen(method, getter)]
pub fn source(this: &WebTransportError) -> WebTransportErrorSource;
/// ```webidl
/// readonly attribute unsigned long? streamErrorCode;
/// ```
///
/// <https://w3c.github.io/webtransport/#dom-webtransporterror-streamerrorcode>
#[wasm_bindgen(method, getter = streamErrorCode)]
pub fn stream_error_code(this: &WebTransportError) -> Option<u32>;
}