Skip to main content

web_sys/features/
gen_PublicKeyCredentialDescriptor.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialDescriptor)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PublicKeyCredentialDescriptor` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
12    pub type PublicKeyCredentialDescriptor;
13    #[doc = "Get the `id` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
16    #[wasm_bindgen(method, getter = "id")]
17    pub fn get_id(this: &PublicKeyCredentialDescriptor) -> ::js_sys::Object;
18    #[doc = "Change the `id` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
21    #[wasm_bindgen(method, setter = "id")]
22    pub fn set_id(this: &PublicKeyCredentialDescriptor, val: &::js_sys::Object);
23    #[doc = "Change the `id` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
26    #[wasm_bindgen(method, setter = "id")]
27    pub fn set_id_buffer_source(this: &PublicKeyCredentialDescriptor, val: &::js_sys::Object);
28    #[doc = "Change the `id` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
31    #[wasm_bindgen(method, setter = "id")]
32    pub fn set_id_u8_slice(this: &PublicKeyCredentialDescriptor, val: &mut [u8]);
33    #[doc = "Change the `id` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
36    #[wasm_bindgen(method, setter = "id")]
37    pub fn set_id_u8_array(this: &PublicKeyCredentialDescriptor, val: &::js_sys::Uint8Array);
38    #[doc = "Get the `transports` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
41    #[wasm_bindgen(method, getter = "transports")]
42    pub fn get_transports(this: &PublicKeyCredentialDescriptor) -> Option<::js_sys::Array>;
43    #[doc = "Change the `transports` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
46    #[wasm_bindgen(method, setter = "transports")]
47    pub fn set_transports(this: &PublicKeyCredentialDescriptor, val: &::wasm_bindgen::JsValue);
48    #[cfg(feature = "PublicKeyCredentialType")]
49    #[doc = "Get the `type` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
52    #[wasm_bindgen(method, getter = "type")]
53    pub fn get_type(this: &PublicKeyCredentialDescriptor) -> PublicKeyCredentialType;
54    #[cfg(feature = "PublicKeyCredentialType")]
55    #[doc = "Change the `type` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
58    #[wasm_bindgen(method, setter = "type")]
59    pub fn set_type(this: &PublicKeyCredentialDescriptor, val: PublicKeyCredentialType);
60}
61impl PublicKeyCredentialDescriptor {
62    #[cfg(feature = "PublicKeyCredentialType")]
63    #[doc = "Construct a new `PublicKeyCredentialDescriptor`."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
66    pub fn new(id: &::js_sys::Object, type_: PublicKeyCredentialType) -> Self {
67        #[allow(unused_mut)]
68        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
69        ret.set_id(id);
70        ret.set_type(type_);
71        ret
72    }
73    #[cfg(feature = "PublicKeyCredentialType")]
74    #[doc = "Construct a new `PublicKeyCredentialDescriptor`."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
77    pub fn new_with_u8_slice(id: &mut [u8], type_: PublicKeyCredentialType) -> Self {
78        #[allow(unused_mut)]
79        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
80        ret.set_id_u8_slice(id);
81        ret.set_type(type_);
82        ret
83    }
84    #[cfg(feature = "PublicKeyCredentialType")]
85    #[doc = "Construct a new `PublicKeyCredentialDescriptor`."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
88    pub fn new_with_u8_array(id: &::js_sys::Uint8Array, type_: PublicKeyCredentialType) -> Self {
89        #[allow(unused_mut)]
90        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
91        ret.set_id_u8_array(id);
92        ret.set_type(type_);
93        ret
94    }
95    #[deprecated = "Use `set_id()` instead."]
96    pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self {
97        self.set_id(val);
98        self
99    }
100    #[deprecated = "Use `set_transports()` instead."]
101    pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
102        self.set_transports(val);
103        self
104    }
105    #[cfg(feature = "PublicKeyCredentialType")]
106    #[deprecated = "Use `set_type()` instead."]
107    pub fn type_(&mut self, val: PublicKeyCredentialType) -> &mut Self {
108        self.set_type(val);
109        self
110    }
111}