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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
use js_sys::JsString; use wasm_bindgen::prelude::*; #[wasm_bindgen] #[derive(Clone, Debug, Eq, PartialEq)] pub struct CookiesSetDetails { domain: Option<JsString>, expiration_date: Option<bool>, http_only: Option<bool>, name: Option<JsString>, path: Option<JsString>, secure: Option<bool>, url: JsString, value: Option<JsString>, } #[wasm_bindgen] impl CookiesSetDetails { #[allow(clippy::too_many_arguments)] #[wasm_bindgen(constructor)] pub fn new( domain: Option<JsString>, expiration_date: Option<bool>, http_only: Option<bool>, name: Option<JsString>, path: Option<JsString>, secure: Option<bool>, url: JsString, value: Option<JsString>, ) -> CookiesSetDetails { CookiesSetDetails { domain, expiration_date, http_only, name, path, secure, url, value, } } #[wasm_bindgen(getter)] pub fn domain(&self) -> Option<JsString> { self.domain.clone() } #[wasm_bindgen(setter)] pub fn set_domain(&mut self, value: Option<JsString>) { self.domain = value; } #[wasm_bindgen(getter, js_name = "expirationDate")] pub fn expiration_date(&self) -> Option<bool> { self.expiration_date } #[wasm_bindgen(setter)] pub fn set_expiration_date(&mut self, value: Option<bool>) { self.expiration_date = value; } #[wasm_bindgen(getter, js_name = "httpOnly")] pub fn http_only(&self) -> Option<bool> { self.http_only } #[wasm_bindgen(setter)] pub fn set_http_only(&mut self, value: Option<bool>) { self.http_only = value; } #[wasm_bindgen(getter)] pub fn name(&self) -> Option<JsString> { self.name.clone() } #[wasm_bindgen(setter)] pub fn set_name(&mut self, value: Option<JsString>) { self.name = value; } #[wasm_bindgen(getter)] pub fn path(&self) -> Option<JsString> { self.path.clone() } #[wasm_bindgen(setter)] pub fn set_path(&mut self, value: Option<JsString>) { self.path = value; } #[wasm_bindgen(getter)] pub fn secure(&self) -> Option<bool> { self.secure } #[wasm_bindgen(setter)] pub fn set_secure(&mut self, value: Option<bool>) { self.secure = value; } #[wasm_bindgen(getter)] pub fn url(&self) -> JsString { self.url.clone() } #[wasm_bindgen(setter)] pub fn set_url(&mut self, value: JsString) { self.url = value; } #[wasm_bindgen(getter)] pub fn value(&self) -> Option<JsString> { self.value.clone() } #[wasm_bindgen(setter)] pub fn set_value(&mut self, value: Option<JsString>) { self.value = value; } }