maxcountryman_web_sys/features/
gen_PublicKeyCredentialDescriptor.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 = PublicKeyCredentialDescriptor)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `PublicKeyCredentialDescriptor` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
11    pub type PublicKeyCredentialDescriptor;
12}
13impl PublicKeyCredentialDescriptor {
14    #[cfg(feature = "PublicKeyCredentialType")]
15    #[doc = "Construct a new `PublicKeyCredentialDescriptor`."]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
18    pub fn new(id: &::js_sys::Object, type_: PublicKeyCredentialType) -> Self {
19        #[allow(unused_mut)]
20        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21        ret.id(id);
22        ret.type_(type_);
23        ret
24    }
25    #[doc = "Change the `id` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
28    pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self {
29        use wasm_bindgen::JsValue;
30        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val));
31        debug_assert!(
32            r.is_ok(),
33            "setting properties should never fail on our dictionary objects"
34        );
35        let _ = r;
36        self
37    }
38    #[doc = "Change the `transports` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"]
41    pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
42        use wasm_bindgen::JsValue;
43        let r = ::js_sys::Reflect::set(
44            self.as_ref(),
45            &JsValue::from("transports"),
46            &JsValue::from(val),
47        );
48        debug_assert!(
49            r.is_ok(),
50            "setting properties should never fail on our dictionary objects"
51        );
52        let _ = r;
53        self
54    }
55    #[cfg(feature = "PublicKeyCredentialType")]
56    #[doc = "Change the `type` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"]
59    pub fn type_(&mut self, val: PublicKeyCredentialType) -> &mut Self {
60        use wasm_bindgen::JsValue;
61        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
62        debug_assert!(
63            r.is_ok(),
64            "setting properties should never fail on our dictionary objects"
65        );
66        let _ = r;
67        self
68    }
69}