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