1use serde::{Serialize, Deserialize};
9use serde_json::Value as JsonValue;
10use std::borrow::Cow;
11
12pub type ScriptId<'a> = Cow<'a, str>;
15
16#[derive(Debug, Clone, Serialize, Deserialize, Default)]
19#[serde(rename_all = "camelCase")]
20pub struct SerializationOptions<'a> {
21 serialization: Cow<'a, str>,
22 #[serde(skip_serializing_if = "Option::is_none", rename = "maxDepth")]
24 max_depth: Option<i64>,
25 #[serde(skip_serializing_if = "Option::is_none", rename = "additionalParameters")]
29 additional_parameters: Option<serde_json::Map<String, JsonValue>>,
30}
31
32impl<'a> SerializationOptions<'a> {
33 pub fn builder(serialization: impl Into<Cow<'a, str>>) -> SerializationOptionsBuilder<'a> {
36 SerializationOptionsBuilder {
37 serialization: serialization.into(),
38 max_depth: None,
39 additional_parameters: None,
40 }
41 }
42 pub fn serialization(&self) -> &str { self.serialization.as_ref() }
43 pub fn max_depth(&self) -> Option<i64> { self.max_depth }
45 pub fn additional_parameters(&self) -> Option<&serde_json::Map<String, JsonValue>> { self.additional_parameters.as_ref() }
49}
50
51
52pub struct SerializationOptionsBuilder<'a> {
53 serialization: Cow<'a, str>,
54 max_depth: Option<i64>,
55 additional_parameters: Option<serde_json::Map<String, JsonValue>>,
56}
57
58impl<'a> SerializationOptionsBuilder<'a> {
59 pub fn max_depth(mut self, max_depth: i64) -> Self { self.max_depth = Some(max_depth); self }
61 pub fn additional_parameters(mut self, additional_parameters: serde_json::Map<String, JsonValue>) -> Self { self.additional_parameters = Some(additional_parameters); self }
65 pub fn build(self) -> SerializationOptions<'a> {
66 SerializationOptions {
67 serialization: self.serialization,
68 max_depth: self.max_depth,
69 additional_parameters: self.additional_parameters,
70 }
71 }
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize, Default)]
77#[serde(rename_all = "camelCase")]
78pub struct DeepSerializedValue<'a> {
79 #[serde(rename = "type")]
80 type_: Cow<'a, str>,
81 #[serde(skip_serializing_if = "Option::is_none")]
82 value: Option<JsonValue>,
83 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
84 object_id: Option<Cow<'a, str>>,
85 #[serde(skip_serializing_if = "Option::is_none", rename = "weakLocalObjectReference")]
89 weak_local_object_reference: Option<i64>,
90}
91
92impl<'a> DeepSerializedValue<'a> {
93 pub fn builder(type_: impl Into<Cow<'a, str>>) -> DeepSerializedValueBuilder<'a> {
96 DeepSerializedValueBuilder {
97 type_: type_.into(),
98 value: None,
99 object_id: None,
100 weak_local_object_reference: None,
101 }
102 }
103 pub fn type_(&self) -> &str { self.type_.as_ref() }
104 pub fn value(&self) -> Option<&JsonValue> { self.value.as_ref() }
105 pub fn object_id(&self) -> Option<&str> { self.object_id.as_deref() }
106 pub fn weak_local_object_reference(&self) -> Option<i64> { self.weak_local_object_reference }
110}
111
112
113pub struct DeepSerializedValueBuilder<'a> {
114 type_: Cow<'a, str>,
115 value: Option<JsonValue>,
116 object_id: Option<Cow<'a, str>>,
117 weak_local_object_reference: Option<i64>,
118}
119
120impl<'a> DeepSerializedValueBuilder<'a> {
121 pub fn value(mut self, value: JsonValue) -> Self { self.value = Some(value); self }
122 pub fn object_id(mut self, object_id: impl Into<Cow<'a, str>>) -> Self { self.object_id = Some(object_id.into()); self }
123 pub fn weak_local_object_reference(mut self, weak_local_object_reference: i64) -> Self { self.weak_local_object_reference = Some(weak_local_object_reference); self }
127 pub fn build(self) -> DeepSerializedValue<'a> {
128 DeepSerializedValue {
129 type_: self.type_,
130 value: self.value,
131 object_id: self.object_id,
132 weak_local_object_reference: self.weak_local_object_reference,
133 }
134 }
135}
136
137pub type RemoteObjectId<'a> = Cow<'a, str>;
140
141pub type UnserializableValue<'a> = Cow<'a, str>;
145
146#[derive(Debug, Clone, Serialize, Deserialize, Default)]
149#[serde(rename_all = "camelCase")]
150pub struct RemoteObject<'a> {
151 #[serde(rename = "type")]
153 type_: Cow<'a, str>,
154 #[serde(skip_serializing_if = "Option::is_none")]
158 subtype: Option<Cow<'a, str>>,
159 #[serde(skip_serializing_if = "Option::is_none", rename = "className")]
161 class_name: Option<Cow<'a, str>>,
162 #[serde(skip_serializing_if = "Option::is_none")]
164 value: Option<JsonValue>,
165 #[serde(skip_serializing_if = "Option::is_none", rename = "unserializableValue")]
168 unserializable_value: Option<UnserializableValue<'a>>,
169 #[serde(skip_serializing_if = "Option::is_none")]
171 description: Option<Cow<'a, str>>,
172 #[serde(skip_serializing_if = "Option::is_none", rename = "deepSerializedValue")]
174 deep_serialized_value: Option<DeepSerializedValue<'a>>,
175 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
177 object_id: Option<RemoteObjectId<'a>>,
178 #[serde(skip_serializing_if = "Option::is_none")]
180 preview: Option<ObjectPreview<'a>>,
181 #[serde(skip_serializing_if = "Option::is_none", rename = "customPreview")]
182 custom_preview: Option<CustomPreview<'a>>,
183}
184
185impl<'a> RemoteObject<'a> {
186 pub fn builder(type_: impl Into<Cow<'a, str>>) -> RemoteObjectBuilder<'a> {
189 RemoteObjectBuilder {
190 type_: type_.into(),
191 subtype: None,
192 class_name: None,
193 value: None,
194 unserializable_value: None,
195 description: None,
196 deep_serialized_value: None,
197 object_id: None,
198 preview: None,
199 custom_preview: None,
200 }
201 }
202 pub fn type_(&self) -> &str { self.type_.as_ref() }
204 pub fn subtype(&self) -> Option<&str> { self.subtype.as_deref() }
208 pub fn class_name(&self) -> Option<&str> { self.class_name.as_deref() }
210 pub fn value(&self) -> Option<&JsonValue> { self.value.as_ref() }
212 pub fn unserializable_value(&self) -> Option<&UnserializableValue<'a>> { self.unserializable_value.as_ref() }
215 pub fn description(&self) -> Option<&str> { self.description.as_deref() }
217 pub fn deep_serialized_value(&self) -> Option<&DeepSerializedValue<'a>> { self.deep_serialized_value.as_ref() }
219 pub fn object_id(&self) -> Option<&RemoteObjectId<'a>> { self.object_id.as_ref() }
221 pub fn preview(&self) -> Option<&ObjectPreview<'a>> { self.preview.as_ref() }
223 pub fn custom_preview(&self) -> Option<&CustomPreview<'a>> { self.custom_preview.as_ref() }
224}
225
226
227pub struct RemoteObjectBuilder<'a> {
228 type_: Cow<'a, str>,
229 subtype: Option<Cow<'a, str>>,
230 class_name: Option<Cow<'a, str>>,
231 value: Option<JsonValue>,
232 unserializable_value: Option<UnserializableValue<'a>>,
233 description: Option<Cow<'a, str>>,
234 deep_serialized_value: Option<DeepSerializedValue<'a>>,
235 object_id: Option<RemoteObjectId<'a>>,
236 preview: Option<ObjectPreview<'a>>,
237 custom_preview: Option<CustomPreview<'a>>,
238}
239
240impl<'a> RemoteObjectBuilder<'a> {
241 pub fn subtype(mut self, subtype: impl Into<Cow<'a, str>>) -> Self { self.subtype = Some(subtype.into()); self }
245 pub fn class_name(mut self, class_name: impl Into<Cow<'a, str>>) -> Self { self.class_name = Some(class_name.into()); self }
247 pub fn value(mut self, value: JsonValue) -> Self { self.value = Some(value); self }
249 pub fn unserializable_value(mut self, unserializable_value: impl Into<UnserializableValue<'a>>) -> Self { self.unserializable_value = Some(unserializable_value.into()); self }
252 pub fn description(mut self, description: impl Into<Cow<'a, str>>) -> Self { self.description = Some(description.into()); self }
254 pub fn deep_serialized_value(mut self, deep_serialized_value: DeepSerializedValue<'a>) -> Self { self.deep_serialized_value = Some(deep_serialized_value); self }
256 pub fn object_id(mut self, object_id: impl Into<RemoteObjectId<'a>>) -> Self { self.object_id = Some(object_id.into()); self }
258 pub fn preview(mut self, preview: ObjectPreview<'a>) -> Self { self.preview = Some(preview); self }
260 pub fn custom_preview(mut self, custom_preview: CustomPreview<'a>) -> Self { self.custom_preview = Some(custom_preview); self }
261 pub fn build(self) -> RemoteObject<'a> {
262 RemoteObject {
263 type_: self.type_,
264 subtype: self.subtype,
265 class_name: self.class_name,
266 value: self.value,
267 unserializable_value: self.unserializable_value,
268 description: self.description,
269 deep_serialized_value: self.deep_serialized_value,
270 object_id: self.object_id,
271 preview: self.preview,
272 custom_preview: self.custom_preview,
273 }
274 }
275}
276
277
278#[derive(Debug, Clone, Serialize, Deserialize, Default)]
279#[serde(rename_all = "camelCase")]
280pub struct CustomPreview<'a> {
281 header: Cow<'a, str>,
284 #[serde(skip_serializing_if = "Option::is_none", rename = "bodyGetterId")]
288 body_getter_id: Option<RemoteObjectId<'a>>,
289}
290
291impl<'a> CustomPreview<'a> {
292 pub fn builder(header: impl Into<Cow<'a, str>>) -> CustomPreviewBuilder<'a> {
295 CustomPreviewBuilder {
296 header: header.into(),
297 body_getter_id: None,
298 }
299 }
300 pub fn header(&self) -> &str { self.header.as_ref() }
303 pub fn body_getter_id(&self) -> Option<&RemoteObjectId<'a>> { self.body_getter_id.as_ref() }
307}
308
309
310pub struct CustomPreviewBuilder<'a> {
311 header: Cow<'a, str>,
312 body_getter_id: Option<RemoteObjectId<'a>>,
313}
314
315impl<'a> CustomPreviewBuilder<'a> {
316 pub fn body_getter_id(mut self, body_getter_id: impl Into<RemoteObjectId<'a>>) -> Self { self.body_getter_id = Some(body_getter_id.into()); self }
320 pub fn build(self) -> CustomPreview<'a> {
321 CustomPreview {
322 header: self.header,
323 body_getter_id: self.body_getter_id,
324 }
325 }
326}
327
328#[derive(Debug, Clone, Serialize, Deserialize, Default)]
331#[serde(rename_all = "camelCase")]
332pub struct ObjectPreview<'a> {
333 #[serde(rename = "type")]
335 type_: Cow<'a, str>,
336 #[serde(skip_serializing_if = "Option::is_none")]
338 subtype: Option<Cow<'a, str>>,
339 #[serde(skip_serializing_if = "Option::is_none")]
341 description: Option<Cow<'a, str>>,
342 overflow: bool,
344 properties: Vec<PropertyPreview<'a>>,
346 #[serde(skip_serializing_if = "Option::is_none")]
348 entries: Option<Vec<EntryPreview<'a>>>,
349}
350
351impl<'a> ObjectPreview<'a> {
352 pub fn builder(type_: impl Into<Cow<'a, str>>, overflow: bool, properties: Vec<PropertyPreview<'a>>) -> ObjectPreviewBuilder<'a> {
357 ObjectPreviewBuilder {
358 type_: type_.into(),
359 subtype: None,
360 description: None,
361 overflow: overflow,
362 properties: properties,
363 entries: None,
364 }
365 }
366 pub fn type_(&self) -> &str { self.type_.as_ref() }
368 pub fn subtype(&self) -> Option<&str> { self.subtype.as_deref() }
370 pub fn description(&self) -> Option<&str> { self.description.as_deref() }
372 pub fn overflow(&self) -> bool { self.overflow }
374 pub fn properties(&self) -> &[PropertyPreview<'a>] { &self.properties }
376 pub fn entries(&self) -> Option<&[EntryPreview<'a>]> { self.entries.as_deref() }
378}
379
380
381pub struct ObjectPreviewBuilder<'a> {
382 type_: Cow<'a, str>,
383 subtype: Option<Cow<'a, str>>,
384 description: Option<Cow<'a, str>>,
385 overflow: bool,
386 properties: Vec<PropertyPreview<'a>>,
387 entries: Option<Vec<EntryPreview<'a>>>,
388}
389
390impl<'a> ObjectPreviewBuilder<'a> {
391 pub fn subtype(mut self, subtype: impl Into<Cow<'a, str>>) -> Self { self.subtype = Some(subtype.into()); self }
393 pub fn description(mut self, description: impl Into<Cow<'a, str>>) -> Self { self.description = Some(description.into()); self }
395 pub fn entries(mut self, entries: Vec<EntryPreview<'a>>) -> Self { self.entries = Some(entries); self }
397 pub fn build(self) -> ObjectPreview<'a> {
398 ObjectPreview {
399 type_: self.type_,
400 subtype: self.subtype,
401 description: self.description,
402 overflow: self.overflow,
403 properties: self.properties,
404 entries: self.entries,
405 }
406 }
407}
408
409
410#[derive(Debug, Clone, Serialize, Deserialize, Default)]
411#[serde(rename_all = "camelCase")]
412pub struct PropertyPreview<'a> {
413 name: Cow<'a, str>,
415 #[serde(rename = "type")]
417 type_: Cow<'a, str>,
418 #[serde(skip_serializing_if = "Option::is_none")]
420 value: Option<Cow<'a, str>>,
421 #[serde(skip_serializing_if = "Option::is_none", rename = "valuePreview")]
423 value_preview: Option<ObjectPreview<'a>>,
424 #[serde(skip_serializing_if = "Option::is_none")]
426 subtype: Option<Cow<'a, str>>,
427}
428
429impl<'a> PropertyPreview<'a> {
430 pub fn builder(name: impl Into<Cow<'a, str>>, type_: impl Into<Cow<'a, str>>) -> PropertyPreviewBuilder<'a> {
434 PropertyPreviewBuilder {
435 name: name.into(),
436 type_: type_.into(),
437 value: None,
438 value_preview: None,
439 subtype: None,
440 }
441 }
442 pub fn name(&self) -> &str { self.name.as_ref() }
444 pub fn type_(&self) -> &str { self.type_.as_ref() }
446 pub fn value(&self) -> Option<&str> { self.value.as_deref() }
448 pub fn value_preview(&self) -> Option<&ObjectPreview<'a>> { self.value_preview.as_ref() }
450 pub fn subtype(&self) -> Option<&str> { self.subtype.as_deref() }
452}
453
454
455pub struct PropertyPreviewBuilder<'a> {
456 name: Cow<'a, str>,
457 type_: Cow<'a, str>,
458 value: Option<Cow<'a, str>>,
459 value_preview: Option<ObjectPreview<'a>>,
460 subtype: Option<Cow<'a, str>>,
461}
462
463impl<'a> PropertyPreviewBuilder<'a> {
464 pub fn value(mut self, value: impl Into<Cow<'a, str>>) -> Self { self.value = Some(value.into()); self }
466 pub fn value_preview(mut self, value_preview: ObjectPreview<'a>) -> Self { self.value_preview = Some(value_preview); self }
468 pub fn subtype(mut self, subtype: impl Into<Cow<'a, str>>) -> Self { self.subtype = Some(subtype.into()); self }
470 pub fn build(self) -> PropertyPreview<'a> {
471 PropertyPreview {
472 name: self.name,
473 type_: self.type_,
474 value: self.value,
475 value_preview: self.value_preview,
476 subtype: self.subtype,
477 }
478 }
479}
480
481
482#[derive(Debug, Clone, Serialize, Deserialize, Default)]
483#[serde(rename_all = "camelCase")]
484pub struct EntryPreview<'a> {
485 #[serde(skip_serializing_if = "Option::is_none")]
487 key: Option<ObjectPreview<'a>>,
488 value: ObjectPreview<'a>,
490}
491
492impl<'a> EntryPreview<'a> {
493 pub fn builder(value: ObjectPreview<'a>) -> EntryPreviewBuilder<'a> {
496 EntryPreviewBuilder {
497 key: None,
498 value: value,
499 }
500 }
501 pub fn key(&self) -> Option<&ObjectPreview<'a>> { self.key.as_ref() }
503 pub fn value(&self) -> &ObjectPreview<'a> { &self.value }
505}
506
507
508pub struct EntryPreviewBuilder<'a> {
509 key: Option<ObjectPreview<'a>>,
510 value: ObjectPreview<'a>,
511}
512
513impl<'a> EntryPreviewBuilder<'a> {
514 pub fn key(mut self, key: ObjectPreview<'a>) -> Self { self.key = Some(key); self }
516 pub fn build(self) -> EntryPreview<'a> {
517 EntryPreview {
518 key: self.key,
519 value: self.value,
520 }
521 }
522}
523
524#[derive(Debug, Clone, Serialize, Deserialize, Default)]
527#[serde(rename_all = "camelCase")]
528pub struct PropertyDescriptor<'a> {
529 name: Cow<'a, str>,
531 #[serde(skip_serializing_if = "Option::is_none")]
533 value: Option<RemoteObject<'a>>,
534 #[serde(skip_serializing_if = "Option::is_none")]
536 writable: Option<bool>,
537 #[serde(skip_serializing_if = "Option::is_none")]
540 get: Option<RemoteObject<'a>>,
541 #[serde(skip_serializing_if = "Option::is_none")]
544 set: Option<RemoteObject<'a>>,
545 configurable: bool,
548 enumerable: bool,
551 #[serde(skip_serializing_if = "Option::is_none", rename = "wasThrown")]
553 was_thrown: Option<bool>,
554 #[serde(skip_serializing_if = "Option::is_none", rename = "isOwn")]
556 is_own: Option<bool>,
557 #[serde(skip_serializing_if = "Option::is_none")]
559 symbol: Option<RemoteObject<'a>>,
560}
561
562impl<'a> PropertyDescriptor<'a> {
563 pub fn builder(name: impl Into<Cow<'a, str>>, configurable: bool, enumerable: bool) -> PropertyDescriptorBuilder<'a> {
568 PropertyDescriptorBuilder {
569 name: name.into(),
570 value: None,
571 writable: None,
572 get: None,
573 set: None,
574 configurable: configurable,
575 enumerable: enumerable,
576 was_thrown: None,
577 is_own: None,
578 symbol: None,
579 }
580 }
581 pub fn name(&self) -> &str { self.name.as_ref() }
583 pub fn value(&self) -> Option<&RemoteObject<'a>> { self.value.as_ref() }
585 pub fn writable(&self) -> Option<bool> { self.writable }
587 pub fn get(&self) -> Option<&RemoteObject<'a>> { self.get.as_ref() }
590 pub fn set(&self) -> Option<&RemoteObject<'a>> { self.set.as_ref() }
593 pub fn configurable(&self) -> bool { self.configurable }
596 pub fn enumerable(&self) -> bool { self.enumerable }
599 pub fn was_thrown(&self) -> Option<bool> { self.was_thrown }
601 pub fn is_own(&self) -> Option<bool> { self.is_own }
603 pub fn symbol(&self) -> Option<&RemoteObject<'a>> { self.symbol.as_ref() }
605}
606
607
608pub struct PropertyDescriptorBuilder<'a> {
609 name: Cow<'a, str>,
610 value: Option<RemoteObject<'a>>,
611 writable: Option<bool>,
612 get: Option<RemoteObject<'a>>,
613 set: Option<RemoteObject<'a>>,
614 configurable: bool,
615 enumerable: bool,
616 was_thrown: Option<bool>,
617 is_own: Option<bool>,
618 symbol: Option<RemoteObject<'a>>,
619}
620
621impl<'a> PropertyDescriptorBuilder<'a> {
622 pub fn value(mut self, value: RemoteObject<'a>) -> Self { self.value = Some(value); self }
624 pub fn writable(mut self, writable: bool) -> Self { self.writable = Some(writable); self }
626 pub fn get(mut self, get: RemoteObject<'a>) -> Self { self.get = Some(get); self }
629 pub fn set(mut self, set: RemoteObject<'a>) -> Self { self.set = Some(set); self }
632 pub fn was_thrown(mut self, was_thrown: bool) -> Self { self.was_thrown = Some(was_thrown); self }
634 pub fn is_own(mut self, is_own: bool) -> Self { self.is_own = Some(is_own); self }
636 pub fn symbol(mut self, symbol: RemoteObject<'a>) -> Self { self.symbol = Some(symbol); self }
638 pub fn build(self) -> PropertyDescriptor<'a> {
639 PropertyDescriptor {
640 name: self.name,
641 value: self.value,
642 writable: self.writable,
643 get: self.get,
644 set: self.set,
645 configurable: self.configurable,
646 enumerable: self.enumerable,
647 was_thrown: self.was_thrown,
648 is_own: self.is_own,
649 symbol: self.symbol,
650 }
651 }
652}
653
654#[derive(Debug, Clone, Serialize, Deserialize, Default)]
657#[serde(rename_all = "camelCase")]
658pub struct InternalPropertyDescriptor<'a> {
659 name: Cow<'a, str>,
661 #[serde(skip_serializing_if = "Option::is_none")]
663 value: Option<RemoteObject<'a>>,
664}
665
666impl<'a> InternalPropertyDescriptor<'a> {
667 pub fn builder(name: impl Into<Cow<'a, str>>) -> InternalPropertyDescriptorBuilder<'a> {
670 InternalPropertyDescriptorBuilder {
671 name: name.into(),
672 value: None,
673 }
674 }
675 pub fn name(&self) -> &str { self.name.as_ref() }
677 pub fn value(&self) -> Option<&RemoteObject<'a>> { self.value.as_ref() }
679}
680
681
682pub struct InternalPropertyDescriptorBuilder<'a> {
683 name: Cow<'a, str>,
684 value: Option<RemoteObject<'a>>,
685}
686
687impl<'a> InternalPropertyDescriptorBuilder<'a> {
688 pub fn value(mut self, value: RemoteObject<'a>) -> Self { self.value = Some(value); self }
690 pub fn build(self) -> InternalPropertyDescriptor<'a> {
691 InternalPropertyDescriptor {
692 name: self.name,
693 value: self.value,
694 }
695 }
696}
697
698#[derive(Debug, Clone, Serialize, Deserialize, Default)]
701#[serde(rename_all = "camelCase")]
702pub struct PrivatePropertyDescriptor<'a> {
703 name: Cow<'a, str>,
705 #[serde(skip_serializing_if = "Option::is_none")]
707 value: Option<RemoteObject<'a>>,
708 #[serde(skip_serializing_if = "Option::is_none")]
711 get: Option<RemoteObject<'a>>,
712 #[serde(skip_serializing_if = "Option::is_none")]
715 set: Option<RemoteObject<'a>>,
716}
717
718impl<'a> PrivatePropertyDescriptor<'a> {
719 pub fn builder(name: impl Into<Cow<'a, str>>) -> PrivatePropertyDescriptorBuilder<'a> {
722 PrivatePropertyDescriptorBuilder {
723 name: name.into(),
724 value: None,
725 get: None,
726 set: None,
727 }
728 }
729 pub fn name(&self) -> &str { self.name.as_ref() }
731 pub fn value(&self) -> Option<&RemoteObject<'a>> { self.value.as_ref() }
733 pub fn get(&self) -> Option<&RemoteObject<'a>> { self.get.as_ref() }
736 pub fn set(&self) -> Option<&RemoteObject<'a>> { self.set.as_ref() }
739}
740
741
742pub struct PrivatePropertyDescriptorBuilder<'a> {
743 name: Cow<'a, str>,
744 value: Option<RemoteObject<'a>>,
745 get: Option<RemoteObject<'a>>,
746 set: Option<RemoteObject<'a>>,
747}
748
749impl<'a> PrivatePropertyDescriptorBuilder<'a> {
750 pub fn value(mut self, value: RemoteObject<'a>) -> Self { self.value = Some(value); self }
752 pub fn get(mut self, get: RemoteObject<'a>) -> Self { self.get = Some(get); self }
755 pub fn set(mut self, set: RemoteObject<'a>) -> Self { self.set = Some(set); self }
758 pub fn build(self) -> PrivatePropertyDescriptor<'a> {
759 PrivatePropertyDescriptor {
760 name: self.name,
761 value: self.value,
762 get: self.get,
763 set: self.set,
764 }
765 }
766}
767
768#[derive(Debug, Clone, Serialize, Deserialize, Default)]
772#[serde(rename_all = "camelCase")]
773pub struct CallArgument<'a> {
774 #[serde(skip_serializing_if = "Option::is_none")]
776 value: Option<JsonValue>,
777 #[serde(skip_serializing_if = "Option::is_none", rename = "unserializableValue")]
779 unserializable_value: Option<UnserializableValue<'a>>,
780 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
782 object_id: Option<RemoteObjectId<'a>>,
783}
784
785impl<'a> CallArgument<'a> {
786 pub fn builder() -> CallArgumentBuilder<'a> {
788 CallArgumentBuilder {
789 value: None,
790 unserializable_value: None,
791 object_id: None,
792 }
793 }
794 pub fn value(&self) -> Option<&JsonValue> { self.value.as_ref() }
796 pub fn unserializable_value(&self) -> Option<&UnserializableValue<'a>> { self.unserializable_value.as_ref() }
798 pub fn object_id(&self) -> Option<&RemoteObjectId<'a>> { self.object_id.as_ref() }
800}
801
802#[derive(Default)]
803pub struct CallArgumentBuilder<'a> {
804 value: Option<JsonValue>,
805 unserializable_value: Option<UnserializableValue<'a>>,
806 object_id: Option<RemoteObjectId<'a>>,
807}
808
809impl<'a> CallArgumentBuilder<'a> {
810 pub fn value(mut self, value: JsonValue) -> Self { self.value = Some(value); self }
812 pub fn unserializable_value(mut self, unserializable_value: impl Into<UnserializableValue<'a>>) -> Self { self.unserializable_value = Some(unserializable_value.into()); self }
814 pub fn object_id(mut self, object_id: impl Into<RemoteObjectId<'a>>) -> Self { self.object_id = Some(object_id.into()); self }
816 pub fn build(self) -> CallArgument<'a> {
817 CallArgument {
818 value: self.value,
819 unserializable_value: self.unserializable_value,
820 object_id: self.object_id,
821 }
822 }
823}
824
825pub type ExecutionContextId = i64;
828
829#[derive(Debug, Clone, Serialize, Deserialize, Default)]
832#[serde(rename_all = "camelCase")]
833pub struct ExecutionContextDescription<'a> {
834 id: ExecutionContextId,
837 origin: Cow<'a, str>,
839 name: Cow<'a, str>,
841 #[serde(rename = "uniqueId")]
845 unique_id: Cow<'a, str>,
846 #[serde(skip_serializing_if = "Option::is_none", rename = "auxData")]
848 aux_data: Option<serde_json::Map<String, JsonValue>>,
849}
850
851impl<'a> ExecutionContextDescription<'a> {
852 pub fn builder(id: ExecutionContextId, origin: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>, unique_id: impl Into<Cow<'a, str>>) -> ExecutionContextDescriptionBuilder<'a> {
858 ExecutionContextDescriptionBuilder {
859 id: id,
860 origin: origin.into(),
861 name: name.into(),
862 unique_id: unique_id.into(),
863 aux_data: None,
864 }
865 }
866 pub fn id(&self) -> &ExecutionContextId { &self.id }
869 pub fn origin(&self) -> &str { self.origin.as_ref() }
871 pub fn name(&self) -> &str { self.name.as_ref() }
873 pub fn unique_id(&self) -> &str { self.unique_id.as_ref() }
877 pub fn aux_data(&self) -> Option<&serde_json::Map<String, JsonValue>> { self.aux_data.as_ref() }
879}
880
881
882pub struct ExecutionContextDescriptionBuilder<'a> {
883 id: ExecutionContextId,
884 origin: Cow<'a, str>,
885 name: Cow<'a, str>,
886 unique_id: Cow<'a, str>,
887 aux_data: Option<serde_json::Map<String, JsonValue>>,
888}
889
890impl<'a> ExecutionContextDescriptionBuilder<'a> {
891 pub fn aux_data(mut self, aux_data: serde_json::Map<String, JsonValue>) -> Self { self.aux_data = Some(aux_data); self }
893 pub fn build(self) -> ExecutionContextDescription<'a> {
894 ExecutionContextDescription {
895 id: self.id,
896 origin: self.origin,
897 name: self.name,
898 unique_id: self.unique_id,
899 aux_data: self.aux_data,
900 }
901 }
902}
903
904#[derive(Debug, Clone, Serialize, Deserialize, Default)]
908#[serde(rename_all = "camelCase")]
909pub struct ExceptionDetails<'a> {
910 #[serde(rename = "exceptionId")]
912 exception_id: u64,
913 text: Cow<'a, str>,
915 #[serde(rename = "lineNumber")]
917 line_number: i64,
918 #[serde(rename = "columnNumber")]
920 column_number: i64,
921 #[serde(skip_serializing_if = "Option::is_none", rename = "scriptId")]
923 script_id: Option<ScriptId<'a>>,
924 #[serde(skip_serializing_if = "Option::is_none")]
926 url: Option<Cow<'a, str>>,
927 #[serde(skip_serializing_if = "Option::is_none", rename = "stackTrace")]
929 stack_trace: Option<StackTrace<'a>>,
930 #[serde(skip_serializing_if = "Option::is_none")]
932 exception: Option<RemoteObject<'a>>,
933 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
935 execution_context_id: Option<ExecutionContextId>,
936 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionMetaData")]
940 exception_meta_data: Option<serde_json::Map<String, JsonValue>>,
941}
942
943impl<'a> ExceptionDetails<'a> {
944 pub fn builder(exception_id: u64, text: impl Into<Cow<'a, str>>, line_number: i64, column_number: i64) -> ExceptionDetailsBuilder<'a> {
950 ExceptionDetailsBuilder {
951 exception_id: exception_id,
952 text: text.into(),
953 line_number: line_number,
954 column_number: column_number,
955 script_id: None,
956 url: None,
957 stack_trace: None,
958 exception: None,
959 execution_context_id: None,
960 exception_meta_data: None,
961 }
962 }
963 pub fn exception_id(&self) -> u64 { self.exception_id }
965 pub fn text(&self) -> &str { self.text.as_ref() }
967 pub fn line_number(&self) -> i64 { self.line_number }
969 pub fn column_number(&self) -> i64 { self.column_number }
971 pub fn script_id(&self) -> Option<&ScriptId<'a>> { self.script_id.as_ref() }
973 pub fn url(&self) -> Option<&str> { self.url.as_deref() }
975 pub fn stack_trace(&self) -> Option<&StackTrace<'a>> { self.stack_trace.as_ref() }
977 pub fn exception(&self) -> Option<&RemoteObject<'a>> { self.exception.as_ref() }
979 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
981 pub fn exception_meta_data(&self) -> Option<&serde_json::Map<String, JsonValue>> { self.exception_meta_data.as_ref() }
985}
986
987
988pub struct ExceptionDetailsBuilder<'a> {
989 exception_id: u64,
990 text: Cow<'a, str>,
991 line_number: i64,
992 column_number: i64,
993 script_id: Option<ScriptId<'a>>,
994 url: Option<Cow<'a, str>>,
995 stack_trace: Option<StackTrace<'a>>,
996 exception: Option<RemoteObject<'a>>,
997 execution_context_id: Option<ExecutionContextId>,
998 exception_meta_data: Option<serde_json::Map<String, JsonValue>>,
999}
1000
1001impl<'a> ExceptionDetailsBuilder<'a> {
1002 pub fn script_id(mut self, script_id: impl Into<ScriptId<'a>>) -> Self { self.script_id = Some(script_id.into()); self }
1004 pub fn url(mut self, url: impl Into<Cow<'a, str>>) -> Self { self.url = Some(url.into()); self }
1006 pub fn stack_trace(mut self, stack_trace: StackTrace<'a>) -> Self { self.stack_trace = Some(stack_trace); self }
1008 pub fn exception(mut self, exception: RemoteObject<'a>) -> Self { self.exception = Some(exception); self }
1010 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
1012 pub fn exception_meta_data(mut self, exception_meta_data: serde_json::Map<String, JsonValue>) -> Self { self.exception_meta_data = Some(exception_meta_data); self }
1016 pub fn build(self) -> ExceptionDetails<'a> {
1017 ExceptionDetails {
1018 exception_id: self.exception_id,
1019 text: self.text,
1020 line_number: self.line_number,
1021 column_number: self.column_number,
1022 script_id: self.script_id,
1023 url: self.url,
1024 stack_trace: self.stack_trace,
1025 exception: self.exception,
1026 execution_context_id: self.execution_context_id,
1027 exception_meta_data: self.exception_meta_data,
1028 }
1029 }
1030}
1031
1032pub type Timestamp = f64;
1035
1036pub type TimeDelta = f64;
1039
1040#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1043#[serde(rename_all = "camelCase")]
1044pub struct CallFrame<'a> {
1045 #[serde(rename = "functionName")]
1047 function_name: Cow<'a, str>,
1048 #[serde(rename = "scriptId")]
1050 script_id: ScriptId<'a>,
1051 url: Cow<'a, str>,
1053 #[serde(rename = "lineNumber")]
1055 line_number: i64,
1056 #[serde(rename = "columnNumber")]
1058 column_number: i64,
1059}
1060
1061impl<'a> CallFrame<'a> {
1062 pub fn builder(function_name: impl Into<Cow<'a, str>>, script_id: impl Into<ScriptId<'a>>, url: impl Into<Cow<'a, str>>, line_number: i64, column_number: i64) -> CallFrameBuilder<'a> {
1069 CallFrameBuilder {
1070 function_name: function_name.into(),
1071 script_id: script_id.into(),
1072 url: url.into(),
1073 line_number: line_number,
1074 column_number: column_number,
1075 }
1076 }
1077 pub fn function_name(&self) -> &str { self.function_name.as_ref() }
1079 pub fn script_id(&self) -> &ScriptId<'a> { &self.script_id }
1081 pub fn url(&self) -> &str { self.url.as_ref() }
1083 pub fn line_number(&self) -> i64 { self.line_number }
1085 pub fn column_number(&self) -> i64 { self.column_number }
1087}
1088
1089
1090pub struct CallFrameBuilder<'a> {
1091 function_name: Cow<'a, str>,
1092 script_id: ScriptId<'a>,
1093 url: Cow<'a, str>,
1094 line_number: i64,
1095 column_number: i64,
1096}
1097
1098impl<'a> CallFrameBuilder<'a> {
1099 pub fn build(self) -> CallFrame<'a> {
1100 CallFrame {
1101 function_name: self.function_name,
1102 script_id: self.script_id,
1103 url: self.url,
1104 line_number: self.line_number,
1105 column_number: self.column_number,
1106 }
1107 }
1108}
1109
1110#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1113#[serde(rename_all = "camelCase")]
1114pub struct StackTrace<'a> {
1115 #[serde(skip_serializing_if = "Option::is_none")]
1118 description: Option<Cow<'a, str>>,
1119 #[serde(rename = "callFrames")]
1121 call_frames: Vec<CallFrame<'a>>,
1122 #[serde(skip_serializing_if = "Option::is_none")]
1124 parent: Option<Box<StackTrace<'a>>>,
1125 #[serde(skip_serializing_if = "Option::is_none", rename = "parentId")]
1127 parent_id: Option<StackTraceId<'a>>,
1128}
1129
1130impl<'a> StackTrace<'a> {
1131 pub fn builder(call_frames: Vec<CallFrame<'a>>) -> StackTraceBuilder<'a> {
1134 StackTraceBuilder {
1135 description: None,
1136 call_frames: call_frames,
1137 parent: None,
1138 parent_id: None,
1139 }
1140 }
1141 pub fn description(&self) -> Option<&str> { self.description.as_deref() }
1144 pub fn call_frames(&self) -> &[CallFrame<'a>] { &self.call_frames }
1146 pub fn parent(&self) -> Option<&StackTrace<'a>> { self.parent.as_deref() }
1148 pub fn parent_id(&self) -> Option<&StackTraceId<'a>> { self.parent_id.as_ref() }
1150}
1151
1152
1153pub struct StackTraceBuilder<'a> {
1154 description: Option<Cow<'a, str>>,
1155 call_frames: Vec<CallFrame<'a>>,
1156 parent: Option<Box<StackTrace<'a>>>,
1157 parent_id: Option<StackTraceId<'a>>,
1158}
1159
1160impl<'a> StackTraceBuilder<'a> {
1161 pub fn description(mut self, description: impl Into<Cow<'a, str>>) -> Self { self.description = Some(description.into()); self }
1164 pub fn parent(mut self, parent: Box<StackTrace<'a>>) -> Self { self.parent = Some(parent); self }
1166 pub fn parent_id(mut self, parent_id: StackTraceId<'a>) -> Self { self.parent_id = Some(parent_id); self }
1168 pub fn build(self) -> StackTrace<'a> {
1169 StackTrace {
1170 description: self.description,
1171 call_frames: self.call_frames,
1172 parent: self.parent,
1173 parent_id: self.parent_id,
1174 }
1175 }
1176}
1177
1178pub type UniqueDebuggerId<'a> = Cow<'a, str>;
1181
1182#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1186#[serde(rename_all = "camelCase")]
1187pub struct StackTraceId<'a> {
1188 id: Cow<'a, str>,
1189 #[serde(skip_serializing_if = "Option::is_none", rename = "debuggerId")]
1190 debugger_id: Option<UniqueDebuggerId<'a>>,
1191}
1192
1193impl<'a> StackTraceId<'a> {
1194 pub fn builder(id: impl Into<Cow<'a, str>>) -> StackTraceIdBuilder<'a> {
1197 StackTraceIdBuilder {
1198 id: id.into(),
1199 debugger_id: None,
1200 }
1201 }
1202 pub fn id(&self) -> &str { self.id.as_ref() }
1203 pub fn debugger_id(&self) -> Option<&UniqueDebuggerId<'a>> { self.debugger_id.as_ref() }
1204}
1205
1206
1207pub struct StackTraceIdBuilder<'a> {
1208 id: Cow<'a, str>,
1209 debugger_id: Option<UniqueDebuggerId<'a>>,
1210}
1211
1212impl<'a> StackTraceIdBuilder<'a> {
1213 pub fn debugger_id(mut self, debugger_id: impl Into<UniqueDebuggerId<'a>>) -> Self { self.debugger_id = Some(debugger_id.into()); self }
1214 pub fn build(self) -> StackTraceId<'a> {
1215 StackTraceId {
1216 id: self.id,
1217 debugger_id: self.debugger_id,
1218 }
1219 }
1220}
1221
1222#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1225#[serde(rename_all = "camelCase")]
1226pub struct AwaitPromiseParams<'a> {
1227 #[serde(rename = "promiseObjectId")]
1229 promise_object_id: RemoteObjectId<'a>,
1230 #[serde(skip_serializing_if = "Option::is_none", rename = "returnByValue")]
1232 return_by_value: Option<bool>,
1233 #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
1235 generate_preview: Option<bool>,
1236}
1237
1238impl<'a> AwaitPromiseParams<'a> {
1239 pub fn builder(promise_object_id: impl Into<RemoteObjectId<'a>>) -> AwaitPromiseParamsBuilder<'a> {
1242 AwaitPromiseParamsBuilder {
1243 promise_object_id: promise_object_id.into(),
1244 return_by_value: None,
1245 generate_preview: None,
1246 }
1247 }
1248 pub fn promise_object_id(&self) -> &RemoteObjectId<'a> { &self.promise_object_id }
1250 pub fn return_by_value(&self) -> Option<bool> { self.return_by_value }
1252 pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
1254}
1255
1256
1257pub struct AwaitPromiseParamsBuilder<'a> {
1258 promise_object_id: RemoteObjectId<'a>,
1259 return_by_value: Option<bool>,
1260 generate_preview: Option<bool>,
1261}
1262
1263impl<'a> AwaitPromiseParamsBuilder<'a> {
1264 pub fn return_by_value(mut self, return_by_value: bool) -> Self { self.return_by_value = Some(return_by_value); self }
1266 pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
1268 pub fn build(self) -> AwaitPromiseParams<'a> {
1269 AwaitPromiseParams {
1270 promise_object_id: self.promise_object_id,
1271 return_by_value: self.return_by_value,
1272 generate_preview: self.generate_preview,
1273 }
1274 }
1275}
1276
1277#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1280#[serde(rename_all = "camelCase")]
1281pub struct AwaitPromiseReturns<'a> {
1282 result: RemoteObject<'a>,
1284 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
1286 exception_details: Option<ExceptionDetails<'a>>,
1287}
1288
1289impl<'a> AwaitPromiseReturns<'a> {
1290 pub fn builder(result: RemoteObject<'a>) -> AwaitPromiseReturnsBuilder<'a> {
1293 AwaitPromiseReturnsBuilder {
1294 result: result,
1295 exception_details: None,
1296 }
1297 }
1298 pub fn result(&self) -> &RemoteObject<'a> { &self.result }
1300 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
1302}
1303
1304
1305pub struct AwaitPromiseReturnsBuilder<'a> {
1306 result: RemoteObject<'a>,
1307 exception_details: Option<ExceptionDetails<'a>>,
1308}
1309
1310impl<'a> AwaitPromiseReturnsBuilder<'a> {
1311 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
1313 pub fn build(self) -> AwaitPromiseReturns<'a> {
1314 AwaitPromiseReturns {
1315 result: self.result,
1316 exception_details: self.exception_details,
1317 }
1318 }
1319}
1320
1321impl<'a> AwaitPromiseParams<'a> { pub const METHOD: &'static str = "Runtime.awaitPromise"; }
1322
1323impl<'a> crate::CdpCommand<'a> for AwaitPromiseParams<'a> {
1324 const METHOD: &'static str = "Runtime.awaitPromise";
1325 type Response = AwaitPromiseReturns<'a>;
1326}
1327
1328#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1332#[serde(rename_all = "camelCase")]
1333pub struct CallFunctionOnParams<'a> {
1334 #[serde(rename = "functionDeclaration")]
1336 function_declaration: Cow<'a, str>,
1337 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1340 object_id: Option<RemoteObjectId<'a>>,
1341 #[serde(skip_serializing_if = "Option::is_none")]
1344 arguments: Option<Vec<CallArgument<'a>>>,
1345 #[serde(skip_serializing_if = "Option::is_none")]
1348 silent: Option<bool>,
1349 #[serde(skip_serializing_if = "Option::is_none", rename = "returnByValue")]
1352 return_by_value: Option<bool>,
1353 #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
1355 generate_preview: Option<bool>,
1356 #[serde(skip_serializing_if = "Option::is_none", rename = "userGesture")]
1358 user_gesture: Option<bool>,
1359 #[serde(skip_serializing_if = "Option::is_none", rename = "awaitPromise")]
1362 await_promise: Option<bool>,
1363 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
1366 execution_context_id: Option<ExecutionContextId>,
1367 #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
1370 object_group: Option<Cow<'a, str>>,
1371 #[serde(skip_serializing_if = "Option::is_none", rename = "throwOnSideEffect")]
1373 throw_on_side_effect: Option<bool>,
1374 #[serde(skip_serializing_if = "Option::is_none", rename = "uniqueContextId")]
1381 unique_context_id: Option<Cow<'a, str>>,
1382 #[serde(skip_serializing_if = "Option::is_none", rename = "serializationOptions")]
1385 serialization_options: Option<SerializationOptions<'a>>,
1386}
1387
1388impl<'a> CallFunctionOnParams<'a> {
1389 pub fn builder(function_declaration: impl Into<Cow<'a, str>>) -> CallFunctionOnParamsBuilder<'a> {
1392 CallFunctionOnParamsBuilder {
1393 function_declaration: function_declaration.into(),
1394 object_id: None,
1395 arguments: None,
1396 silent: None,
1397 return_by_value: None,
1398 generate_preview: None,
1399 user_gesture: None,
1400 await_promise: None,
1401 execution_context_id: None,
1402 object_group: None,
1403 throw_on_side_effect: None,
1404 unique_context_id: None,
1405 serialization_options: None,
1406 }
1407 }
1408 pub fn function_declaration(&self) -> &str { self.function_declaration.as_ref() }
1410 pub fn object_id(&self) -> Option<&RemoteObjectId<'a>> { self.object_id.as_ref() }
1413 pub fn arguments(&self) -> Option<&[CallArgument<'a>]> { self.arguments.as_deref() }
1416 pub fn silent(&self) -> Option<bool> { self.silent }
1419 pub fn return_by_value(&self) -> Option<bool> { self.return_by_value }
1422 pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
1424 pub fn user_gesture(&self) -> Option<bool> { self.user_gesture }
1426 pub fn await_promise(&self) -> Option<bool> { self.await_promise }
1429 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
1432 pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
1435 pub fn throw_on_side_effect(&self) -> Option<bool> { self.throw_on_side_effect }
1437 pub fn unique_context_id(&self) -> Option<&str> { self.unique_context_id.as_deref() }
1444 pub fn serialization_options(&self) -> Option<&SerializationOptions<'a>> { self.serialization_options.as_ref() }
1447}
1448
1449
1450pub struct CallFunctionOnParamsBuilder<'a> {
1451 function_declaration: Cow<'a, str>,
1452 object_id: Option<RemoteObjectId<'a>>,
1453 arguments: Option<Vec<CallArgument<'a>>>,
1454 silent: Option<bool>,
1455 return_by_value: Option<bool>,
1456 generate_preview: Option<bool>,
1457 user_gesture: Option<bool>,
1458 await_promise: Option<bool>,
1459 execution_context_id: Option<ExecutionContextId>,
1460 object_group: Option<Cow<'a, str>>,
1461 throw_on_side_effect: Option<bool>,
1462 unique_context_id: Option<Cow<'a, str>>,
1463 serialization_options: Option<SerializationOptions<'a>>,
1464}
1465
1466impl<'a> CallFunctionOnParamsBuilder<'a> {
1467 pub fn object_id(mut self, object_id: impl Into<RemoteObjectId<'a>>) -> Self { self.object_id = Some(object_id.into()); self }
1470 pub fn arguments(mut self, arguments: Vec<CallArgument<'a>>) -> Self { self.arguments = Some(arguments); self }
1473 pub fn silent(mut self, silent: bool) -> Self { self.silent = Some(silent); self }
1476 pub fn return_by_value(mut self, return_by_value: bool) -> Self { self.return_by_value = Some(return_by_value); self }
1479 pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
1481 pub fn user_gesture(mut self, user_gesture: bool) -> Self { self.user_gesture = Some(user_gesture); self }
1483 pub fn await_promise(mut self, await_promise: bool) -> Self { self.await_promise = Some(await_promise); self }
1486 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
1489 pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
1492 pub fn throw_on_side_effect(mut self, throw_on_side_effect: bool) -> Self { self.throw_on_side_effect = Some(throw_on_side_effect); self }
1494 pub fn unique_context_id(mut self, unique_context_id: impl Into<Cow<'a, str>>) -> Self { self.unique_context_id = Some(unique_context_id.into()); self }
1501 pub fn serialization_options(mut self, serialization_options: SerializationOptions<'a>) -> Self { self.serialization_options = Some(serialization_options); self }
1504 pub fn build(self) -> CallFunctionOnParams<'a> {
1505 CallFunctionOnParams {
1506 function_declaration: self.function_declaration,
1507 object_id: self.object_id,
1508 arguments: self.arguments,
1509 silent: self.silent,
1510 return_by_value: self.return_by_value,
1511 generate_preview: self.generate_preview,
1512 user_gesture: self.user_gesture,
1513 await_promise: self.await_promise,
1514 execution_context_id: self.execution_context_id,
1515 object_group: self.object_group,
1516 throw_on_side_effect: self.throw_on_side_effect,
1517 unique_context_id: self.unique_context_id,
1518 serialization_options: self.serialization_options,
1519 }
1520 }
1521}
1522
1523#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1527#[serde(rename_all = "camelCase")]
1528pub struct CallFunctionOnReturns<'a> {
1529 result: RemoteObject<'a>,
1531 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
1533 exception_details: Option<ExceptionDetails<'a>>,
1534}
1535
1536impl<'a> CallFunctionOnReturns<'a> {
1537 pub fn builder(result: RemoteObject<'a>) -> CallFunctionOnReturnsBuilder<'a> {
1540 CallFunctionOnReturnsBuilder {
1541 result: result,
1542 exception_details: None,
1543 }
1544 }
1545 pub fn result(&self) -> &RemoteObject<'a> { &self.result }
1547 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
1549}
1550
1551
1552pub struct CallFunctionOnReturnsBuilder<'a> {
1553 result: RemoteObject<'a>,
1554 exception_details: Option<ExceptionDetails<'a>>,
1555}
1556
1557impl<'a> CallFunctionOnReturnsBuilder<'a> {
1558 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
1560 pub fn build(self) -> CallFunctionOnReturns<'a> {
1561 CallFunctionOnReturns {
1562 result: self.result,
1563 exception_details: self.exception_details,
1564 }
1565 }
1566}
1567
1568impl<'a> CallFunctionOnParams<'a> { pub const METHOD: &'static str = "Runtime.callFunctionOn"; }
1569
1570impl<'a> crate::CdpCommand<'a> for CallFunctionOnParams<'a> {
1571 const METHOD: &'static str = "Runtime.callFunctionOn";
1572 type Response = CallFunctionOnReturns<'a>;
1573}
1574
1575#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1578#[serde(rename_all = "camelCase")]
1579pub struct CompileScriptParams<'a> {
1580 expression: Cow<'a, str>,
1582 #[serde(rename = "sourceURL")]
1584 source_url: Cow<'a, str>,
1585 #[serde(rename = "persistScript")]
1587 persist_script: bool,
1588 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
1591 execution_context_id: Option<ExecutionContextId>,
1592}
1593
1594impl<'a> CompileScriptParams<'a> {
1595 pub fn builder(expression: impl Into<Cow<'a, str>>, source_url: impl Into<Cow<'a, str>>, persist_script: bool) -> CompileScriptParamsBuilder<'a> {
1600 CompileScriptParamsBuilder {
1601 expression: expression.into(),
1602 source_url: source_url.into(),
1603 persist_script: persist_script,
1604 execution_context_id: None,
1605 }
1606 }
1607 pub fn expression(&self) -> &str { self.expression.as_ref() }
1609 pub fn source_url(&self) -> &str { self.source_url.as_ref() }
1611 pub fn persist_script(&self) -> bool { self.persist_script }
1613 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
1616}
1617
1618
1619pub struct CompileScriptParamsBuilder<'a> {
1620 expression: Cow<'a, str>,
1621 source_url: Cow<'a, str>,
1622 persist_script: bool,
1623 execution_context_id: Option<ExecutionContextId>,
1624}
1625
1626impl<'a> CompileScriptParamsBuilder<'a> {
1627 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
1630 pub fn build(self) -> CompileScriptParams<'a> {
1631 CompileScriptParams {
1632 expression: self.expression,
1633 source_url: self.source_url,
1634 persist_script: self.persist_script,
1635 execution_context_id: self.execution_context_id,
1636 }
1637 }
1638}
1639
1640#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1643#[serde(rename_all = "camelCase")]
1644pub struct CompileScriptReturns<'a> {
1645 #[serde(skip_serializing_if = "Option::is_none", rename = "scriptId")]
1647 script_id: Option<ScriptId<'a>>,
1648 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
1650 exception_details: Option<ExceptionDetails<'a>>,
1651}
1652
1653impl<'a> CompileScriptReturns<'a> {
1654 pub fn builder() -> CompileScriptReturnsBuilder<'a> {
1656 CompileScriptReturnsBuilder {
1657 script_id: None,
1658 exception_details: None,
1659 }
1660 }
1661 pub fn script_id(&self) -> Option<&ScriptId<'a>> { self.script_id.as_ref() }
1663 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
1665}
1666
1667#[derive(Default)]
1668pub struct CompileScriptReturnsBuilder<'a> {
1669 script_id: Option<ScriptId<'a>>,
1670 exception_details: Option<ExceptionDetails<'a>>,
1671}
1672
1673impl<'a> CompileScriptReturnsBuilder<'a> {
1674 pub fn script_id(mut self, script_id: impl Into<ScriptId<'a>>) -> Self { self.script_id = Some(script_id.into()); self }
1676 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
1678 pub fn build(self) -> CompileScriptReturns<'a> {
1679 CompileScriptReturns {
1680 script_id: self.script_id,
1681 exception_details: self.exception_details,
1682 }
1683 }
1684}
1685
1686impl<'a> CompileScriptParams<'a> { pub const METHOD: &'static str = "Runtime.compileScript"; }
1687
1688impl<'a> crate::CdpCommand<'a> for CompileScriptParams<'a> {
1689 const METHOD: &'static str = "Runtime.compileScript";
1690 type Response = CompileScriptReturns<'a>;
1691}
1692
1693#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1694pub struct DisableParams {}
1695
1696impl DisableParams { pub const METHOD: &'static str = "Runtime.disable"; }
1697
1698impl<'a> crate::CdpCommand<'a> for DisableParams {
1699 const METHOD: &'static str = "Runtime.disable";
1700 type Response = crate::EmptyReturns;
1701}
1702
1703#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1704pub struct DiscardConsoleEntriesParams {}
1705
1706impl DiscardConsoleEntriesParams { pub const METHOD: &'static str = "Runtime.discardConsoleEntries"; }
1707
1708impl<'a> crate::CdpCommand<'a> for DiscardConsoleEntriesParams {
1709 const METHOD: &'static str = "Runtime.discardConsoleEntries";
1710 type Response = crate::EmptyReturns;
1711}
1712
1713#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1714pub struct EnableParams {}
1715
1716impl EnableParams { pub const METHOD: &'static str = "Runtime.enable"; }
1717
1718impl<'a> crate::CdpCommand<'a> for EnableParams {
1719 const METHOD: &'static str = "Runtime.enable";
1720 type Response = crate::EmptyReturns;
1721}
1722
1723#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1726#[serde(rename_all = "camelCase")]
1727pub struct EvaluateParams<'a> {
1728 expression: Cow<'a, str>,
1730 #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
1732 object_group: Option<Cow<'a, str>>,
1733 #[serde(skip_serializing_if = "Option::is_none", rename = "includeCommandLineAPI")]
1735 include_command_line_api: Option<bool>,
1736 #[serde(skip_serializing_if = "Option::is_none")]
1739 silent: Option<bool>,
1740 #[serde(skip_serializing_if = "Option::is_none", rename = "contextId")]
1746 context_id: Option<ExecutionContextId>,
1747 #[serde(skip_serializing_if = "Option::is_none", rename = "returnByValue")]
1749 return_by_value: Option<bool>,
1750 #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
1752 generate_preview: Option<bool>,
1753 #[serde(skip_serializing_if = "Option::is_none", rename = "userGesture")]
1755 user_gesture: Option<bool>,
1756 #[serde(skip_serializing_if = "Option::is_none", rename = "awaitPromise")]
1759 await_promise: Option<bool>,
1760 #[serde(skip_serializing_if = "Option::is_none", rename = "throwOnSideEffect")]
1763 throw_on_side_effect: Option<bool>,
1764 #[serde(skip_serializing_if = "Option::is_none")]
1766 timeout: Option<TimeDelta>,
1767 #[serde(skip_serializing_if = "Option::is_none", rename = "disableBreaks")]
1769 disable_breaks: Option<bool>,
1770 #[serde(skip_serializing_if = "Option::is_none", rename = "replMode")]
1774 repl_mode: Option<bool>,
1775 #[serde(skip_serializing_if = "Option::is_none", rename = "allowUnsafeEvalBlockedByCSP")]
1780 allow_unsafe_eval_blocked_by_csp: Option<bool>,
1781 #[serde(skip_serializing_if = "Option::is_none", rename = "uniqueContextId")]
1788 unique_context_id: Option<Cow<'a, str>>,
1789 #[serde(skip_serializing_if = "Option::is_none", rename = "serializationOptions")]
1792 serialization_options: Option<SerializationOptions<'a>>,
1793}
1794
1795impl<'a> EvaluateParams<'a> {
1796 pub fn builder(expression: impl Into<Cow<'a, str>>) -> EvaluateParamsBuilder<'a> {
1799 EvaluateParamsBuilder {
1800 expression: expression.into(),
1801 object_group: None,
1802 include_command_line_api: None,
1803 silent: None,
1804 context_id: None,
1805 return_by_value: None,
1806 generate_preview: None,
1807 user_gesture: None,
1808 await_promise: None,
1809 throw_on_side_effect: None,
1810 timeout: None,
1811 disable_breaks: None,
1812 repl_mode: None,
1813 allow_unsafe_eval_blocked_by_csp: None,
1814 unique_context_id: None,
1815 serialization_options: None,
1816 }
1817 }
1818 pub fn expression(&self) -> &str { self.expression.as_ref() }
1820 pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
1822 pub fn include_command_line_api(&self) -> Option<bool> { self.include_command_line_api }
1824 pub fn silent(&self) -> Option<bool> { self.silent }
1827 pub fn context_id(&self) -> Option<&ExecutionContextId> { self.context_id.as_ref() }
1833 pub fn return_by_value(&self) -> Option<bool> { self.return_by_value }
1835 pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
1837 pub fn user_gesture(&self) -> Option<bool> { self.user_gesture }
1839 pub fn await_promise(&self) -> Option<bool> { self.await_promise }
1842 pub fn throw_on_side_effect(&self) -> Option<bool> { self.throw_on_side_effect }
1845 pub fn timeout(&self) -> Option<&TimeDelta> { self.timeout.as_ref() }
1847 pub fn disable_breaks(&self) -> Option<bool> { self.disable_breaks }
1849 pub fn repl_mode(&self) -> Option<bool> { self.repl_mode }
1853 pub fn allow_unsafe_eval_blocked_by_csp(&self) -> Option<bool> { self.allow_unsafe_eval_blocked_by_csp }
1858 pub fn unique_context_id(&self) -> Option<&str> { self.unique_context_id.as_deref() }
1865 pub fn serialization_options(&self) -> Option<&SerializationOptions<'a>> { self.serialization_options.as_ref() }
1868}
1869
1870
1871pub struct EvaluateParamsBuilder<'a> {
1872 expression: Cow<'a, str>,
1873 object_group: Option<Cow<'a, str>>,
1874 include_command_line_api: Option<bool>,
1875 silent: Option<bool>,
1876 context_id: Option<ExecutionContextId>,
1877 return_by_value: Option<bool>,
1878 generate_preview: Option<bool>,
1879 user_gesture: Option<bool>,
1880 await_promise: Option<bool>,
1881 throw_on_side_effect: Option<bool>,
1882 timeout: Option<TimeDelta>,
1883 disable_breaks: Option<bool>,
1884 repl_mode: Option<bool>,
1885 allow_unsafe_eval_blocked_by_csp: Option<bool>,
1886 unique_context_id: Option<Cow<'a, str>>,
1887 serialization_options: Option<SerializationOptions<'a>>,
1888}
1889
1890impl<'a> EvaluateParamsBuilder<'a> {
1891 pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
1893 pub fn include_command_line_api(mut self, include_command_line_api: bool) -> Self { self.include_command_line_api = Some(include_command_line_api); self }
1895 pub fn silent(mut self, silent: bool) -> Self { self.silent = Some(silent); self }
1898 pub fn context_id(mut self, context_id: ExecutionContextId) -> Self { self.context_id = Some(context_id); self }
1904 pub fn return_by_value(mut self, return_by_value: bool) -> Self { self.return_by_value = Some(return_by_value); self }
1906 pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
1908 pub fn user_gesture(mut self, user_gesture: bool) -> Self { self.user_gesture = Some(user_gesture); self }
1910 pub fn await_promise(mut self, await_promise: bool) -> Self { self.await_promise = Some(await_promise); self }
1913 pub fn throw_on_side_effect(mut self, throw_on_side_effect: bool) -> Self { self.throw_on_side_effect = Some(throw_on_side_effect); self }
1916 pub fn timeout(mut self, timeout: TimeDelta) -> Self { self.timeout = Some(timeout); self }
1918 pub fn disable_breaks(mut self, disable_breaks: bool) -> Self { self.disable_breaks = Some(disable_breaks); self }
1920 pub fn repl_mode(mut self, repl_mode: bool) -> Self { self.repl_mode = Some(repl_mode); self }
1924 pub fn allow_unsafe_eval_blocked_by_csp(mut self, allow_unsafe_eval_blocked_by_csp: bool) -> Self { self.allow_unsafe_eval_blocked_by_csp = Some(allow_unsafe_eval_blocked_by_csp); self }
1929 pub fn unique_context_id(mut self, unique_context_id: impl Into<Cow<'a, str>>) -> Self { self.unique_context_id = Some(unique_context_id.into()); self }
1936 pub fn serialization_options(mut self, serialization_options: SerializationOptions<'a>) -> Self { self.serialization_options = Some(serialization_options); self }
1939 pub fn build(self) -> EvaluateParams<'a> {
1940 EvaluateParams {
1941 expression: self.expression,
1942 object_group: self.object_group,
1943 include_command_line_api: self.include_command_line_api,
1944 silent: self.silent,
1945 context_id: self.context_id,
1946 return_by_value: self.return_by_value,
1947 generate_preview: self.generate_preview,
1948 user_gesture: self.user_gesture,
1949 await_promise: self.await_promise,
1950 throw_on_side_effect: self.throw_on_side_effect,
1951 timeout: self.timeout,
1952 disable_breaks: self.disable_breaks,
1953 repl_mode: self.repl_mode,
1954 allow_unsafe_eval_blocked_by_csp: self.allow_unsafe_eval_blocked_by_csp,
1955 unique_context_id: self.unique_context_id,
1956 serialization_options: self.serialization_options,
1957 }
1958 }
1959}
1960
1961#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1964#[serde(rename_all = "camelCase")]
1965pub struct EvaluateReturns<'a> {
1966 result: RemoteObject<'a>,
1968 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
1970 exception_details: Option<ExceptionDetails<'a>>,
1971}
1972
1973impl<'a> EvaluateReturns<'a> {
1974 pub fn builder(result: RemoteObject<'a>) -> EvaluateReturnsBuilder<'a> {
1977 EvaluateReturnsBuilder {
1978 result: result,
1979 exception_details: None,
1980 }
1981 }
1982 pub fn result(&self) -> &RemoteObject<'a> { &self.result }
1984 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
1986}
1987
1988
1989pub struct EvaluateReturnsBuilder<'a> {
1990 result: RemoteObject<'a>,
1991 exception_details: Option<ExceptionDetails<'a>>,
1992}
1993
1994impl<'a> EvaluateReturnsBuilder<'a> {
1995 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
1997 pub fn build(self) -> EvaluateReturns<'a> {
1998 EvaluateReturns {
1999 result: self.result,
2000 exception_details: self.exception_details,
2001 }
2002 }
2003}
2004
2005impl<'a> EvaluateParams<'a> { pub const METHOD: &'static str = "Runtime.evaluate"; }
2006
2007impl<'a> crate::CdpCommand<'a> for EvaluateParams<'a> {
2008 const METHOD: &'static str = "Runtime.evaluate";
2009 type Response = EvaluateReturns<'a>;
2010}
2011
2012#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2015#[serde(rename_all = "camelCase")]
2016pub struct GetIsolateIdReturns<'a> {
2017 id: Cow<'a, str>,
2019}
2020
2021impl<'a> GetIsolateIdReturns<'a> {
2022 pub fn builder(id: impl Into<Cow<'a, str>>) -> GetIsolateIdReturnsBuilder<'a> {
2025 GetIsolateIdReturnsBuilder {
2026 id: id.into(),
2027 }
2028 }
2029 pub fn id(&self) -> &str { self.id.as_ref() }
2031}
2032
2033
2034pub struct GetIsolateIdReturnsBuilder<'a> {
2035 id: Cow<'a, str>,
2036}
2037
2038impl<'a> GetIsolateIdReturnsBuilder<'a> {
2039 pub fn build(self) -> GetIsolateIdReturns<'a> {
2040 GetIsolateIdReturns {
2041 id: self.id,
2042 }
2043 }
2044}
2045
2046#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2047pub struct GetIsolateIdParams {}
2048
2049impl GetIsolateIdParams { pub const METHOD: &'static str = "Runtime.getIsolateId"; }
2050
2051impl<'a> crate::CdpCommand<'a> for GetIsolateIdParams {
2052 const METHOD: &'static str = "Runtime.getIsolateId";
2053 type Response = GetIsolateIdReturns<'a>;
2054}
2055
2056#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2060#[serde(rename_all = "camelCase")]
2061pub struct GetHeapUsageReturns {
2062 #[serde(rename = "usedSize")]
2064 used_size: f64,
2065 #[serde(rename = "totalSize")]
2067 total_size: f64,
2068 #[serde(rename = "embedderHeapUsedSize")]
2070 embedder_heap_used_size: f64,
2071 #[serde(rename = "backingStorageSize")]
2073 backing_storage_size: f64,
2074}
2075
2076impl GetHeapUsageReturns {
2077 pub fn builder(used_size: f64, total_size: f64, embedder_heap_used_size: f64, backing_storage_size: f64) -> GetHeapUsageReturnsBuilder {
2083 GetHeapUsageReturnsBuilder {
2084 used_size: used_size,
2085 total_size: total_size,
2086 embedder_heap_used_size: embedder_heap_used_size,
2087 backing_storage_size: backing_storage_size,
2088 }
2089 }
2090 pub fn used_size(&self) -> f64 { self.used_size }
2092 pub fn total_size(&self) -> f64 { self.total_size }
2094 pub fn embedder_heap_used_size(&self) -> f64 { self.embedder_heap_used_size }
2096 pub fn backing_storage_size(&self) -> f64 { self.backing_storage_size }
2098}
2099
2100
2101pub struct GetHeapUsageReturnsBuilder {
2102 used_size: f64,
2103 total_size: f64,
2104 embedder_heap_used_size: f64,
2105 backing_storage_size: f64,
2106}
2107
2108impl GetHeapUsageReturnsBuilder {
2109 pub fn build(self) -> GetHeapUsageReturns {
2110 GetHeapUsageReturns {
2111 used_size: self.used_size,
2112 total_size: self.total_size,
2113 embedder_heap_used_size: self.embedder_heap_used_size,
2114 backing_storage_size: self.backing_storage_size,
2115 }
2116 }
2117}
2118
2119#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2120pub struct GetHeapUsageParams {}
2121
2122impl GetHeapUsageParams { pub const METHOD: &'static str = "Runtime.getHeapUsage"; }
2123
2124impl<'a> crate::CdpCommand<'a> for GetHeapUsageParams {
2125 const METHOD: &'static str = "Runtime.getHeapUsage";
2126 type Response = GetHeapUsageReturns;
2127}
2128
2129#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2133#[serde(rename_all = "camelCase")]
2134pub struct GetPropertiesParams<'a> {
2135 #[serde(rename = "objectId")]
2137 object_id: RemoteObjectId<'a>,
2138 #[serde(skip_serializing_if = "Option::is_none", rename = "ownProperties")]
2141 own_properties: Option<bool>,
2142 #[serde(skip_serializing_if = "Option::is_none", rename = "accessorPropertiesOnly")]
2145 accessor_properties_only: Option<bool>,
2146 #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
2148 generate_preview: Option<bool>,
2149 #[serde(skip_serializing_if = "Option::is_none", rename = "nonIndexedPropertiesOnly")]
2151 non_indexed_properties_only: Option<bool>,
2152}
2153
2154impl<'a> GetPropertiesParams<'a> {
2155 pub fn builder(object_id: impl Into<RemoteObjectId<'a>>) -> GetPropertiesParamsBuilder<'a> {
2158 GetPropertiesParamsBuilder {
2159 object_id: object_id.into(),
2160 own_properties: None,
2161 accessor_properties_only: None,
2162 generate_preview: None,
2163 non_indexed_properties_only: None,
2164 }
2165 }
2166 pub fn object_id(&self) -> &RemoteObjectId<'a> { &self.object_id }
2168 pub fn own_properties(&self) -> Option<bool> { self.own_properties }
2171 pub fn accessor_properties_only(&self) -> Option<bool> { self.accessor_properties_only }
2174 pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
2176 pub fn non_indexed_properties_only(&self) -> Option<bool> { self.non_indexed_properties_only }
2178}
2179
2180
2181pub struct GetPropertiesParamsBuilder<'a> {
2182 object_id: RemoteObjectId<'a>,
2183 own_properties: Option<bool>,
2184 accessor_properties_only: Option<bool>,
2185 generate_preview: Option<bool>,
2186 non_indexed_properties_only: Option<bool>,
2187}
2188
2189impl<'a> GetPropertiesParamsBuilder<'a> {
2190 pub fn own_properties(mut self, own_properties: bool) -> Self { self.own_properties = Some(own_properties); self }
2193 pub fn accessor_properties_only(mut self, accessor_properties_only: bool) -> Self { self.accessor_properties_only = Some(accessor_properties_only); self }
2196 pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
2198 pub fn non_indexed_properties_only(mut self, non_indexed_properties_only: bool) -> Self { self.non_indexed_properties_only = Some(non_indexed_properties_only); self }
2200 pub fn build(self) -> GetPropertiesParams<'a> {
2201 GetPropertiesParams {
2202 object_id: self.object_id,
2203 own_properties: self.own_properties,
2204 accessor_properties_only: self.accessor_properties_only,
2205 generate_preview: self.generate_preview,
2206 non_indexed_properties_only: self.non_indexed_properties_only,
2207 }
2208 }
2209}
2210
2211#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2215#[serde(rename_all = "camelCase")]
2216pub struct GetPropertiesReturns<'a> {
2217 result: Vec<PropertyDescriptor<'a>>,
2219 #[serde(skip_serializing_if = "Option::is_none", rename = "internalProperties")]
2221 internal_properties: Option<Vec<InternalPropertyDescriptor<'a>>>,
2222 #[serde(skip_serializing_if = "Option::is_none", rename = "privateProperties")]
2224 private_properties: Option<Vec<PrivatePropertyDescriptor<'a>>>,
2225 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
2227 exception_details: Option<ExceptionDetails<'a>>,
2228}
2229
2230impl<'a> GetPropertiesReturns<'a> {
2231 pub fn builder(result: Vec<PropertyDescriptor<'a>>) -> GetPropertiesReturnsBuilder<'a> {
2234 GetPropertiesReturnsBuilder {
2235 result: result,
2236 internal_properties: None,
2237 private_properties: None,
2238 exception_details: None,
2239 }
2240 }
2241 pub fn result(&self) -> &[PropertyDescriptor<'a>] { &self.result }
2243 pub fn internal_properties(&self) -> Option<&[InternalPropertyDescriptor<'a>]> { self.internal_properties.as_deref() }
2245 pub fn private_properties(&self) -> Option<&[PrivatePropertyDescriptor<'a>]> { self.private_properties.as_deref() }
2247 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
2249}
2250
2251
2252pub struct GetPropertiesReturnsBuilder<'a> {
2253 result: Vec<PropertyDescriptor<'a>>,
2254 internal_properties: Option<Vec<InternalPropertyDescriptor<'a>>>,
2255 private_properties: Option<Vec<PrivatePropertyDescriptor<'a>>>,
2256 exception_details: Option<ExceptionDetails<'a>>,
2257}
2258
2259impl<'a> GetPropertiesReturnsBuilder<'a> {
2260 pub fn internal_properties(mut self, internal_properties: Vec<InternalPropertyDescriptor<'a>>) -> Self { self.internal_properties = Some(internal_properties); self }
2262 pub fn private_properties(mut self, private_properties: Vec<PrivatePropertyDescriptor<'a>>) -> Self { self.private_properties = Some(private_properties); self }
2264 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
2266 pub fn build(self) -> GetPropertiesReturns<'a> {
2267 GetPropertiesReturns {
2268 result: self.result,
2269 internal_properties: self.internal_properties,
2270 private_properties: self.private_properties,
2271 exception_details: self.exception_details,
2272 }
2273 }
2274}
2275
2276impl<'a> GetPropertiesParams<'a> { pub const METHOD: &'static str = "Runtime.getProperties"; }
2277
2278impl<'a> crate::CdpCommand<'a> for GetPropertiesParams<'a> {
2279 const METHOD: &'static str = "Runtime.getProperties";
2280 type Response = GetPropertiesReturns<'a>;
2281}
2282
2283#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2286#[serde(rename_all = "camelCase")]
2287pub struct GlobalLexicalScopeNamesParams {
2288 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
2290 execution_context_id: Option<ExecutionContextId>,
2291}
2292
2293impl GlobalLexicalScopeNamesParams {
2294 pub fn builder() -> GlobalLexicalScopeNamesParamsBuilder {
2296 GlobalLexicalScopeNamesParamsBuilder {
2297 execution_context_id: None,
2298 }
2299 }
2300 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
2302}
2303
2304#[derive(Default)]
2305pub struct GlobalLexicalScopeNamesParamsBuilder {
2306 execution_context_id: Option<ExecutionContextId>,
2307}
2308
2309impl GlobalLexicalScopeNamesParamsBuilder {
2310 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
2312 pub fn build(self) -> GlobalLexicalScopeNamesParams {
2313 GlobalLexicalScopeNamesParams {
2314 execution_context_id: self.execution_context_id,
2315 }
2316 }
2317}
2318
2319#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2322#[serde(rename_all = "camelCase")]
2323pub struct GlobalLexicalScopeNamesReturns<'a> {
2324 names: Vec<Cow<'a, str>>,
2325}
2326
2327impl<'a> GlobalLexicalScopeNamesReturns<'a> {
2328 pub fn builder(names: Vec<Cow<'a, str>>) -> GlobalLexicalScopeNamesReturnsBuilder<'a> {
2331 GlobalLexicalScopeNamesReturnsBuilder {
2332 names: names,
2333 }
2334 }
2335 pub fn names(&self) -> &[Cow<'a, str>] { &self.names }
2336}
2337
2338
2339pub struct GlobalLexicalScopeNamesReturnsBuilder<'a> {
2340 names: Vec<Cow<'a, str>>,
2341}
2342
2343impl<'a> GlobalLexicalScopeNamesReturnsBuilder<'a> {
2344 pub fn build(self) -> GlobalLexicalScopeNamesReturns<'a> {
2345 GlobalLexicalScopeNamesReturns {
2346 names: self.names,
2347 }
2348 }
2349}
2350
2351impl GlobalLexicalScopeNamesParams { pub const METHOD: &'static str = "Runtime.globalLexicalScopeNames"; }
2352
2353impl<'a> crate::CdpCommand<'a> for GlobalLexicalScopeNamesParams {
2354 const METHOD: &'static str = "Runtime.globalLexicalScopeNames";
2355 type Response = GlobalLexicalScopeNamesReturns<'a>;
2356}
2357
2358
2359#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2360#[serde(rename_all = "camelCase")]
2361pub struct QueryObjectsParams<'a> {
2362 #[serde(rename = "prototypeObjectId")]
2364 prototype_object_id: RemoteObjectId<'a>,
2365 #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
2367 object_group: Option<Cow<'a, str>>,
2368}
2369
2370impl<'a> QueryObjectsParams<'a> {
2371 pub fn builder(prototype_object_id: impl Into<RemoteObjectId<'a>>) -> QueryObjectsParamsBuilder<'a> {
2374 QueryObjectsParamsBuilder {
2375 prototype_object_id: prototype_object_id.into(),
2376 object_group: None,
2377 }
2378 }
2379 pub fn prototype_object_id(&self) -> &RemoteObjectId<'a> { &self.prototype_object_id }
2381 pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
2383}
2384
2385
2386pub struct QueryObjectsParamsBuilder<'a> {
2387 prototype_object_id: RemoteObjectId<'a>,
2388 object_group: Option<Cow<'a, str>>,
2389}
2390
2391impl<'a> QueryObjectsParamsBuilder<'a> {
2392 pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
2394 pub fn build(self) -> QueryObjectsParams<'a> {
2395 QueryObjectsParams {
2396 prototype_object_id: self.prototype_object_id,
2397 object_group: self.object_group,
2398 }
2399 }
2400}
2401
2402
2403#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2404#[serde(rename_all = "camelCase")]
2405pub struct QueryObjectsReturns<'a> {
2406 objects: RemoteObject<'a>,
2408}
2409
2410impl<'a> QueryObjectsReturns<'a> {
2411 pub fn builder(objects: RemoteObject<'a>) -> QueryObjectsReturnsBuilder<'a> {
2414 QueryObjectsReturnsBuilder {
2415 objects: objects,
2416 }
2417 }
2418 pub fn objects(&self) -> &RemoteObject<'a> { &self.objects }
2420}
2421
2422
2423pub struct QueryObjectsReturnsBuilder<'a> {
2424 objects: RemoteObject<'a>,
2425}
2426
2427impl<'a> QueryObjectsReturnsBuilder<'a> {
2428 pub fn build(self) -> QueryObjectsReturns<'a> {
2429 QueryObjectsReturns {
2430 objects: self.objects,
2431 }
2432 }
2433}
2434
2435impl<'a> QueryObjectsParams<'a> { pub const METHOD: &'static str = "Runtime.queryObjects"; }
2436
2437impl<'a> crate::CdpCommand<'a> for QueryObjectsParams<'a> {
2438 const METHOD: &'static str = "Runtime.queryObjects";
2439 type Response = QueryObjectsReturns<'a>;
2440}
2441
2442#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2445#[serde(rename_all = "camelCase")]
2446pub struct ReleaseObjectParams<'a> {
2447 #[serde(rename = "objectId")]
2449 object_id: RemoteObjectId<'a>,
2450}
2451
2452impl<'a> ReleaseObjectParams<'a> {
2453 pub fn builder(object_id: impl Into<RemoteObjectId<'a>>) -> ReleaseObjectParamsBuilder<'a> {
2456 ReleaseObjectParamsBuilder {
2457 object_id: object_id.into(),
2458 }
2459 }
2460 pub fn object_id(&self) -> &RemoteObjectId<'a> { &self.object_id }
2462}
2463
2464
2465pub struct ReleaseObjectParamsBuilder<'a> {
2466 object_id: RemoteObjectId<'a>,
2467}
2468
2469impl<'a> ReleaseObjectParamsBuilder<'a> {
2470 pub fn build(self) -> ReleaseObjectParams<'a> {
2471 ReleaseObjectParams {
2472 object_id: self.object_id,
2473 }
2474 }
2475}
2476
2477impl<'a> ReleaseObjectParams<'a> { pub const METHOD: &'static str = "Runtime.releaseObject"; }
2478
2479impl<'a> crate::CdpCommand<'a> for ReleaseObjectParams<'a> {
2480 const METHOD: &'static str = "Runtime.releaseObject";
2481 type Response = crate::EmptyReturns;
2482}
2483
2484#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2487#[serde(rename_all = "camelCase")]
2488pub struct ReleaseObjectGroupParams<'a> {
2489 #[serde(rename = "objectGroup")]
2491 object_group: Cow<'a, str>,
2492}
2493
2494impl<'a> ReleaseObjectGroupParams<'a> {
2495 pub fn builder(object_group: impl Into<Cow<'a, str>>) -> ReleaseObjectGroupParamsBuilder<'a> {
2498 ReleaseObjectGroupParamsBuilder {
2499 object_group: object_group.into(),
2500 }
2501 }
2502 pub fn object_group(&self) -> &str { self.object_group.as_ref() }
2504}
2505
2506
2507pub struct ReleaseObjectGroupParamsBuilder<'a> {
2508 object_group: Cow<'a, str>,
2509}
2510
2511impl<'a> ReleaseObjectGroupParamsBuilder<'a> {
2512 pub fn build(self) -> ReleaseObjectGroupParams<'a> {
2513 ReleaseObjectGroupParams {
2514 object_group: self.object_group,
2515 }
2516 }
2517}
2518
2519impl<'a> ReleaseObjectGroupParams<'a> { pub const METHOD: &'static str = "Runtime.releaseObjectGroup"; }
2520
2521impl<'a> crate::CdpCommand<'a> for ReleaseObjectGroupParams<'a> {
2522 const METHOD: &'static str = "Runtime.releaseObjectGroup";
2523 type Response = crate::EmptyReturns;
2524}
2525
2526#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2527pub struct RunIfWaitingForDebuggerParams {}
2528
2529impl RunIfWaitingForDebuggerParams { pub const METHOD: &'static str = "Runtime.runIfWaitingForDebugger"; }
2530
2531impl<'a> crate::CdpCommand<'a> for RunIfWaitingForDebuggerParams {
2532 const METHOD: &'static str = "Runtime.runIfWaitingForDebugger";
2533 type Response = crate::EmptyReturns;
2534}
2535
2536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2539#[serde(rename_all = "camelCase")]
2540pub struct RunScriptParams<'a> {
2541 #[serde(rename = "scriptId")]
2543 script_id: ScriptId<'a>,
2544 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
2547 execution_context_id: Option<ExecutionContextId>,
2548 #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
2550 object_group: Option<Cow<'a, str>>,
2551 #[serde(skip_serializing_if = "Option::is_none")]
2554 silent: Option<bool>,
2555 #[serde(skip_serializing_if = "Option::is_none", rename = "includeCommandLineAPI")]
2557 include_command_line_api: Option<bool>,
2558 #[serde(skip_serializing_if = "Option::is_none", rename = "returnByValue")]
2560 return_by_value: Option<bool>,
2561 #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
2563 generate_preview: Option<bool>,
2564 #[serde(skip_serializing_if = "Option::is_none", rename = "awaitPromise")]
2567 await_promise: Option<bool>,
2568}
2569
2570impl<'a> RunScriptParams<'a> {
2571 pub fn builder(script_id: impl Into<ScriptId<'a>>) -> RunScriptParamsBuilder<'a> {
2574 RunScriptParamsBuilder {
2575 script_id: script_id.into(),
2576 execution_context_id: None,
2577 object_group: None,
2578 silent: None,
2579 include_command_line_api: None,
2580 return_by_value: None,
2581 generate_preview: None,
2582 await_promise: None,
2583 }
2584 }
2585 pub fn script_id(&self) -> &ScriptId<'a> { &self.script_id }
2587 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
2590 pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
2592 pub fn silent(&self) -> Option<bool> { self.silent }
2595 pub fn include_command_line_api(&self) -> Option<bool> { self.include_command_line_api }
2597 pub fn return_by_value(&self) -> Option<bool> { self.return_by_value }
2599 pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
2601 pub fn await_promise(&self) -> Option<bool> { self.await_promise }
2604}
2605
2606
2607pub struct RunScriptParamsBuilder<'a> {
2608 script_id: ScriptId<'a>,
2609 execution_context_id: Option<ExecutionContextId>,
2610 object_group: Option<Cow<'a, str>>,
2611 silent: Option<bool>,
2612 include_command_line_api: Option<bool>,
2613 return_by_value: Option<bool>,
2614 generate_preview: Option<bool>,
2615 await_promise: Option<bool>,
2616}
2617
2618impl<'a> RunScriptParamsBuilder<'a> {
2619 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
2622 pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
2624 pub fn silent(mut self, silent: bool) -> Self { self.silent = Some(silent); self }
2627 pub fn include_command_line_api(mut self, include_command_line_api: bool) -> Self { self.include_command_line_api = Some(include_command_line_api); self }
2629 pub fn return_by_value(mut self, return_by_value: bool) -> Self { self.return_by_value = Some(return_by_value); self }
2631 pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
2633 pub fn await_promise(mut self, await_promise: bool) -> Self { self.await_promise = Some(await_promise); self }
2636 pub fn build(self) -> RunScriptParams<'a> {
2637 RunScriptParams {
2638 script_id: self.script_id,
2639 execution_context_id: self.execution_context_id,
2640 object_group: self.object_group,
2641 silent: self.silent,
2642 include_command_line_api: self.include_command_line_api,
2643 return_by_value: self.return_by_value,
2644 generate_preview: self.generate_preview,
2645 await_promise: self.await_promise,
2646 }
2647 }
2648}
2649
2650#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2653#[serde(rename_all = "camelCase")]
2654pub struct RunScriptReturns<'a> {
2655 result: RemoteObject<'a>,
2657 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
2659 exception_details: Option<ExceptionDetails<'a>>,
2660}
2661
2662impl<'a> RunScriptReturns<'a> {
2663 pub fn builder(result: RemoteObject<'a>) -> RunScriptReturnsBuilder<'a> {
2666 RunScriptReturnsBuilder {
2667 result: result,
2668 exception_details: None,
2669 }
2670 }
2671 pub fn result(&self) -> &RemoteObject<'a> { &self.result }
2673 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
2675}
2676
2677
2678pub struct RunScriptReturnsBuilder<'a> {
2679 result: RemoteObject<'a>,
2680 exception_details: Option<ExceptionDetails<'a>>,
2681}
2682
2683impl<'a> RunScriptReturnsBuilder<'a> {
2684 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
2686 pub fn build(self) -> RunScriptReturns<'a> {
2687 RunScriptReturns {
2688 result: self.result,
2689 exception_details: self.exception_details,
2690 }
2691 }
2692}
2693
2694impl<'a> RunScriptParams<'a> { pub const METHOD: &'static str = "Runtime.runScript"; }
2695
2696impl<'a> crate::CdpCommand<'a> for RunScriptParams<'a> {
2697 const METHOD: &'static str = "Runtime.runScript";
2698 type Response = RunScriptReturns<'a>;
2699}
2700
2701#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2704#[serde(rename_all = "camelCase")]
2705pub struct SetAsyncCallStackDepthParams {
2706 #[serde(rename = "maxDepth")]
2709 max_depth: i64,
2710}
2711
2712impl SetAsyncCallStackDepthParams {
2713 pub fn builder(max_depth: i64) -> SetAsyncCallStackDepthParamsBuilder {
2716 SetAsyncCallStackDepthParamsBuilder {
2717 max_depth: max_depth,
2718 }
2719 }
2720 pub fn max_depth(&self) -> i64 { self.max_depth }
2723}
2724
2725
2726pub struct SetAsyncCallStackDepthParamsBuilder {
2727 max_depth: i64,
2728}
2729
2730impl SetAsyncCallStackDepthParamsBuilder {
2731 pub fn build(self) -> SetAsyncCallStackDepthParams {
2732 SetAsyncCallStackDepthParams {
2733 max_depth: self.max_depth,
2734 }
2735 }
2736}
2737
2738impl SetAsyncCallStackDepthParams { pub const METHOD: &'static str = "Runtime.setAsyncCallStackDepth"; }
2739
2740impl<'a> crate::CdpCommand<'a> for SetAsyncCallStackDepthParams {
2741 const METHOD: &'static str = "Runtime.setAsyncCallStackDepth";
2742 type Response = crate::EmptyReturns;
2743}
2744
2745
2746#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2747#[serde(rename_all = "camelCase")]
2748pub struct SetCustomObjectFormatterEnabledParams {
2749 enabled: bool,
2750}
2751
2752impl SetCustomObjectFormatterEnabledParams {
2753 pub fn builder(enabled: bool) -> SetCustomObjectFormatterEnabledParamsBuilder {
2756 SetCustomObjectFormatterEnabledParamsBuilder {
2757 enabled: enabled,
2758 }
2759 }
2760 pub fn enabled(&self) -> bool { self.enabled }
2761}
2762
2763
2764pub struct SetCustomObjectFormatterEnabledParamsBuilder {
2765 enabled: bool,
2766}
2767
2768impl SetCustomObjectFormatterEnabledParamsBuilder {
2769 pub fn build(self) -> SetCustomObjectFormatterEnabledParams {
2770 SetCustomObjectFormatterEnabledParams {
2771 enabled: self.enabled,
2772 }
2773 }
2774}
2775
2776impl SetCustomObjectFormatterEnabledParams { pub const METHOD: &'static str = "Runtime.setCustomObjectFormatterEnabled"; }
2777
2778impl<'a> crate::CdpCommand<'a> for SetCustomObjectFormatterEnabledParams {
2779 const METHOD: &'static str = "Runtime.setCustomObjectFormatterEnabled";
2780 type Response = crate::EmptyReturns;
2781}
2782
2783
2784#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2785#[serde(rename_all = "camelCase")]
2786pub struct SetMaxCallStackSizeToCaptureParams {
2787 size: u64,
2788}
2789
2790impl SetMaxCallStackSizeToCaptureParams {
2791 pub fn builder(size: u64) -> SetMaxCallStackSizeToCaptureParamsBuilder {
2794 SetMaxCallStackSizeToCaptureParamsBuilder {
2795 size: size,
2796 }
2797 }
2798 pub fn size(&self) -> u64 { self.size }
2799}
2800
2801
2802pub struct SetMaxCallStackSizeToCaptureParamsBuilder {
2803 size: u64,
2804}
2805
2806impl SetMaxCallStackSizeToCaptureParamsBuilder {
2807 pub fn build(self) -> SetMaxCallStackSizeToCaptureParams {
2808 SetMaxCallStackSizeToCaptureParams {
2809 size: self.size,
2810 }
2811 }
2812}
2813
2814impl SetMaxCallStackSizeToCaptureParams { pub const METHOD: &'static str = "Runtime.setMaxCallStackSizeToCapture"; }
2815
2816impl<'a> crate::CdpCommand<'a> for SetMaxCallStackSizeToCaptureParams {
2817 const METHOD: &'static str = "Runtime.setMaxCallStackSizeToCapture";
2818 type Response = crate::EmptyReturns;
2819}
2820
2821#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2822pub struct TerminateExecutionParams {}
2823
2824impl TerminateExecutionParams { pub const METHOD: &'static str = "Runtime.terminateExecution"; }
2825
2826impl<'a> crate::CdpCommand<'a> for TerminateExecutionParams {
2827 const METHOD: &'static str = "Runtime.terminateExecution";
2828 type Response = crate::EmptyReturns;
2829}
2830
2831#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2839#[serde(rename_all = "camelCase")]
2840pub struct AddBindingParams<'a> {
2841 name: Cow<'a, str>,
2842 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
2850 execution_context_id: Option<ExecutionContextId>,
2851 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextName")]
2857 execution_context_name: Option<Cow<'a, str>>,
2858}
2859
2860impl<'a> AddBindingParams<'a> {
2861 pub fn builder(name: impl Into<Cow<'a, str>>) -> AddBindingParamsBuilder<'a> {
2864 AddBindingParamsBuilder {
2865 name: name.into(),
2866 execution_context_id: None,
2867 execution_context_name: None,
2868 }
2869 }
2870 pub fn name(&self) -> &str { self.name.as_ref() }
2871 pub fn execution_context_id(&self) -> Option<&ExecutionContextId> { self.execution_context_id.as_ref() }
2879 pub fn execution_context_name(&self) -> Option<&str> { self.execution_context_name.as_deref() }
2885}
2886
2887
2888pub struct AddBindingParamsBuilder<'a> {
2889 name: Cow<'a, str>,
2890 execution_context_id: Option<ExecutionContextId>,
2891 execution_context_name: Option<Cow<'a, str>>,
2892}
2893
2894impl<'a> AddBindingParamsBuilder<'a> {
2895 pub fn execution_context_id(mut self, execution_context_id: ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
2903 pub fn execution_context_name(mut self, execution_context_name: impl Into<Cow<'a, str>>) -> Self { self.execution_context_name = Some(execution_context_name.into()); self }
2909 pub fn build(self) -> AddBindingParams<'a> {
2910 AddBindingParams {
2911 name: self.name,
2912 execution_context_id: self.execution_context_id,
2913 execution_context_name: self.execution_context_name,
2914 }
2915 }
2916}
2917
2918impl<'a> AddBindingParams<'a> { pub const METHOD: &'static str = "Runtime.addBinding"; }
2919
2920impl<'a> crate::CdpCommand<'a> for AddBindingParams<'a> {
2921 const METHOD: &'static str = "Runtime.addBinding";
2922 type Response = crate::EmptyReturns;
2923}
2924
2925#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2929#[serde(rename_all = "camelCase")]
2930pub struct RemoveBindingParams<'a> {
2931 name: Cow<'a, str>,
2932}
2933
2934impl<'a> RemoveBindingParams<'a> {
2935 pub fn builder(name: impl Into<Cow<'a, str>>) -> RemoveBindingParamsBuilder<'a> {
2938 RemoveBindingParamsBuilder {
2939 name: name.into(),
2940 }
2941 }
2942 pub fn name(&self) -> &str { self.name.as_ref() }
2943}
2944
2945
2946pub struct RemoveBindingParamsBuilder<'a> {
2947 name: Cow<'a, str>,
2948}
2949
2950impl<'a> RemoveBindingParamsBuilder<'a> {
2951 pub fn build(self) -> RemoveBindingParams<'a> {
2952 RemoveBindingParams {
2953 name: self.name,
2954 }
2955 }
2956}
2957
2958impl<'a> RemoveBindingParams<'a> { pub const METHOD: &'static str = "Runtime.removeBinding"; }
2959
2960impl<'a> crate::CdpCommand<'a> for RemoveBindingParams<'a> {
2961 const METHOD: &'static str = "Runtime.removeBinding";
2962 type Response = crate::EmptyReturns;
2963}
2964
2965#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2972#[serde(rename_all = "camelCase")]
2973pub struct GetExceptionDetailsParams<'a> {
2974 #[serde(rename = "errorObjectId")]
2976 error_object_id: RemoteObjectId<'a>,
2977}
2978
2979impl<'a> GetExceptionDetailsParams<'a> {
2980 pub fn builder(error_object_id: impl Into<RemoteObjectId<'a>>) -> GetExceptionDetailsParamsBuilder<'a> {
2983 GetExceptionDetailsParamsBuilder {
2984 error_object_id: error_object_id.into(),
2985 }
2986 }
2987 pub fn error_object_id(&self) -> &RemoteObjectId<'a> { &self.error_object_id }
2989}
2990
2991
2992pub struct GetExceptionDetailsParamsBuilder<'a> {
2993 error_object_id: RemoteObjectId<'a>,
2994}
2995
2996impl<'a> GetExceptionDetailsParamsBuilder<'a> {
2997 pub fn build(self) -> GetExceptionDetailsParams<'a> {
2998 GetExceptionDetailsParams {
2999 error_object_id: self.error_object_id,
3000 }
3001 }
3002}
3003
3004#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3011#[serde(rename_all = "camelCase")]
3012pub struct GetExceptionDetailsReturns<'a> {
3013 #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
3014 exception_details: Option<ExceptionDetails<'a>>,
3015}
3016
3017impl<'a> GetExceptionDetailsReturns<'a> {
3018 pub fn builder() -> GetExceptionDetailsReturnsBuilder<'a> {
3020 GetExceptionDetailsReturnsBuilder {
3021 exception_details: None,
3022 }
3023 }
3024 pub fn exception_details(&self) -> Option<&ExceptionDetails<'a>> { self.exception_details.as_ref() }
3025}
3026
3027#[derive(Default)]
3028pub struct GetExceptionDetailsReturnsBuilder<'a> {
3029 exception_details: Option<ExceptionDetails<'a>>,
3030}
3031
3032impl<'a> GetExceptionDetailsReturnsBuilder<'a> {
3033 pub fn exception_details(mut self, exception_details: ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
3034 pub fn build(self) -> GetExceptionDetailsReturns<'a> {
3035 GetExceptionDetailsReturns {
3036 exception_details: self.exception_details,
3037 }
3038 }
3039}
3040
3041impl<'a> GetExceptionDetailsParams<'a> { pub const METHOD: &'static str = "Runtime.getExceptionDetails"; }
3042
3043impl<'a> crate::CdpCommand<'a> for GetExceptionDetailsParams<'a> {
3044 const METHOD: &'static str = "Runtime.getExceptionDetails";
3045 type Response = GetExceptionDetailsReturns<'a>;
3046}