1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct PingRequest {}
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PingResponse {
6 #[prost(string, tag = "1")]
7 pub message: ::prost::alloc::string::String,
8 #[prost(string, tag = "2")]
9 pub version: ::prost::alloc::string::String,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct CommandRetryOptions {
13 #[prost(uint32, optional, tag = "1")]
14 pub timeout_ms: ::core::option::Option<u32>,
15 #[prost(uint32, optional, tag = "2")]
16 pub retry_interval_ms: ::core::option::Option<u32>,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct ConnectMobileCommand {
20 #[prost(enumeration = "MobilePlatform", tag = "1")]
21 pub platform: i32,
22 #[prost(string, optional, tag = "2")]
23 pub device: ::core::option::Option<::prost::alloc::string::String>,
24 #[prost(string, optional, tag = "3")]
25 pub adb_endpoint: ::core::option::Option<::prost::alloc::string::String>,
26 #[prost(bool, tag = "4")]
27 pub preserve_app_state: bool,
28 #[prost(message, optional, tag = "5")]
29 pub retry_options: ::core::option::Option<CommandRetryOptions>,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct MobileConnectedEvent {
33 #[prost(enumeration = "MobilePlatform", tag = "1")]
34 pub platform: i32,
35 #[prost(string, tag = "2")]
36 pub device_name: ::prost::alloc::string::String,
37 #[prost(string, tag = "3")]
38 pub note: ::prost::alloc::string::String,
39 #[prost(string, tag = "4")]
40 pub device_id: ::prost::alloc::string::String,
41 #[prost(enumeration = "DeviceConnectionKind", tag = "5")]
42 pub connection_kind: i32,
43 #[prost(string, tag = "6")]
44 pub backend: ::prost::alloc::string::String,
45 #[prost(string, tag = "7")]
46 pub device_session_id: ::prost::alloc::string::String,
47 #[prost(string, tag = "8")]
48 pub initial_app_session_id: ::prost::alloc::string::String,
49 #[prost(string, optional, tag = "9")]
50 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
51 #[prost(string, optional, tag = "10")]
52 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct LaunchAppCommand {
56 #[prost(string, optional, tag = "1")]
57 pub apk_path: ::core::option::Option<::prost::alloc::string::String>,
58 #[prost(string, optional, tag = "2")]
59 pub app_id: ::core::option::Option<::prost::alloc::string::String>,
60 #[prost(string, optional, tag = "3")]
61 pub launch_activity: ::core::option::Option<::prost::alloc::string::String>,
62 #[prost(bool, tag = "4")]
63 pub stop_before_launch: bool,
64 #[prost(message, optional, tag = "5")]
65 pub retry_options: ::core::option::Option<CommandRetryOptions>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct AppLaunchedEvent {
69 #[prost(string, tag = "1")]
70 pub app_session_id: ::prost::alloc::string::String,
71 #[prost(string, tag = "2")]
72 pub note: ::prost::alloc::string::String,
73 #[prost(string, optional, tag = "3")]
74 pub package_name: ::core::option::Option<::prost::alloc::string::String>,
75 #[prost(string, optional, tag = "4")]
76 pub activity_name: ::core::option::Option<::prost::alloc::string::String>,
77 #[prost(string, optional, tag = "5")]
78 pub webview_context: ::core::option::Option<::prost::alloc::string::String>,
79}
80#[derive(Clone, Copy, PartialEq, ::prost::Message)]
81pub struct RegisterMobileFileChooserHook {}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct MobileFileChooserHookResult {
84 #[prost(string, tag = "1")]
85 pub file_chooser_id: ::prost::alloc::string::String,
86 #[prost(bool, tag = "2")]
87 pub is_multiple: bool,
88 #[prost(string, tag = "3")]
89 pub note: ::prost::alloc::string::String,
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct SetMobileFileChooserFilesCommand {
93 #[prost(string, tag = "1")]
94 pub file_chooser_id: ::prost::alloc::string::String,
95 #[prost(string, repeated, tag = "2")]
96 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
97 #[prost(message, optional, tag = "3")]
98 pub retry_options: ::core::option::Option<CommandRetryOptions>,
99}
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct MobileFileChooserFilesSetEvent {
102 #[prost(string, tag = "1")]
103 pub file_chooser_id: ::prost::alloc::string::String,
104 #[prost(string, repeated, tag = "2")]
105 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
106 #[prost(string, tag = "3")]
107 pub note: ::prost::alloc::string::String,
108}
109#[derive(Clone, Copy, PartialEq, ::prost::Message)]
110pub struct RegisterMobileDownloadHook {}
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct MobileDownloadHookResult {
113 #[prost(string, tag = "1")]
114 pub download_id: ::prost::alloc::string::String,
115 #[prost(string, tag = "2")]
116 pub suggested_filename: ::prost::alloc::string::String,
117 #[prost(string, tag = "3")]
118 pub note: ::prost::alloc::string::String,
119}
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct SaveMobileDownloadCommand {
122 #[prost(string, tag = "1")]
123 pub download_id: ::prost::alloc::string::String,
124 #[prost(message, optional, tag = "2")]
125 pub retry_options: ::core::option::Option<CommandRetryOptions>,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct MobileDownloadSavedEvent {
129 #[prost(string, tag = "1")]
130 pub download_id: ::prost::alloc::string::String,
131 #[prost(string, tag = "2")]
132 pub file_id: ::prost::alloc::string::String,
133 #[prost(string, tag = "3")]
134 pub suggested_filename: ::prost::alloc::string::String,
135 #[prost(uint64, tag = "4")]
136 pub size: u64,
137 #[prost(string, tag = "5")]
138 pub note: ::prost::alloc::string::String,
139}
140#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
141#[repr(i32)]
142pub enum MobilePlatform {
143 Unspecified = 0,
144 Android = 1,
145 Ios = 2,
146}
147impl MobilePlatform {
148 pub fn as_str_name(&self) -> &'static str {
153 match self {
154 Self::Unspecified => "MOBILE_PLATFORM_UNSPECIFIED",
155 Self::Android => "MOBILE_PLATFORM_ANDROID",
156 Self::Ios => "MOBILE_PLATFORM_IOS",
157 }
158 }
159 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
161 match value {
162 "MOBILE_PLATFORM_UNSPECIFIED" => Some(Self::Unspecified),
163 "MOBILE_PLATFORM_ANDROID" => Some(Self::Android),
164 "MOBILE_PLATFORM_IOS" => Some(Self::Ios),
165 _ => None,
166 }
167 }
168}
169#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
170#[repr(i32)]
171pub enum DeviceConnectionKind {
172 Unspecified = 0,
173 Usb = 1,
174 Emulator = 2,
175 RemoteAdb = 3,
176}
177impl DeviceConnectionKind {
178 pub fn as_str_name(&self) -> &'static str {
183 match self {
184 Self::Unspecified => "DEVICE_CONNECTION_KIND_UNSPECIFIED",
185 Self::Usb => "DEVICE_CONNECTION_KIND_USB",
186 Self::Emulator => "DEVICE_CONNECTION_KIND_EMULATOR",
187 Self::RemoteAdb => "DEVICE_CONNECTION_KIND_REMOTE_ADB",
188 }
189 }
190 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
192 match value {
193 "DEVICE_CONNECTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
194 "DEVICE_CONNECTION_KIND_USB" => Some(Self::Usb),
195 "DEVICE_CONNECTION_KIND_EMULATOR" => Some(Self::Emulator),
196 "DEVICE_CONNECTION_KIND_REMOTE_ADB" => Some(Self::RemoteAdb),
197 _ => None,
198 }
199 }
200}
201#[derive(Clone, PartialEq, ::prost::Message)]
202pub struct LaunchBrowserCommand {
203 #[prost(enumeration = "BrowserKind", tag = "1")]
204 pub browser_kind: i32,
205 #[prost(string, optional, tag = "2")]
206 pub browser_binary: ::core::option::Option<::prost::alloc::string::String>,
207 #[prost(message, optional, tag = "3")]
208 pub retry_options: ::core::option::Option<CommandRetryOptions>,
209}
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct BrowserLaunchedEvent {
212 #[prost(enumeration = "BrowserKind", tag = "1")]
213 pub browser_kind: i32,
214 #[prost(string, tag = "2")]
215 pub browser: ::prost::alloc::string::String,
216 #[prost(string, tag = "3")]
217 pub note: ::prost::alloc::string::String,
218 #[prost(string, tag = "4")]
219 pub user_data_dir: ::prost::alloc::string::String,
220 #[prost(string, tag = "5")]
221 pub initial_page_session_id: ::prost::alloc::string::String,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct LaunchChromeCommand {
225 #[prost(string, optional, tag = "1")]
226 pub chrome_binary: ::core::option::Option<::prost::alloc::string::String>,
227 #[prost(message, optional, tag = "2")]
228 pub retry_options: ::core::option::Option<CommandRetryOptions>,
229}
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct ChromeLaunchedEvent {
232 #[prost(string, tag = "1")]
233 pub browser: ::prost::alloc::string::String,
234 #[prost(string, tag = "2")]
235 pub note: ::prost::alloc::string::String,
236 #[prost(string, tag = "3")]
237 pub cdp_websocket_url: ::prost::alloc::string::String,
238 #[prost(string, tag = "4")]
239 pub user_data_dir: ::prost::alloc::string::String,
240 #[prost(string, tag = "5")]
241 pub initial_page_session_id: ::prost::alloc::string::String,
242}
243#[derive(Clone, Copy, PartialEq, ::prost::Message)]
244pub struct RegisterNewPageHook {}
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct NewPageHookResult {
247 #[prost(string, tag = "1")]
248 pub context_session_id: ::prost::alloc::string::String,
249 #[prost(string, tag = "2")]
250 pub note: ::prost::alloc::string::String,
251}
252#[derive(Clone, Copy, PartialEq, ::prost::Message)]
253pub struct RegisterFileChooserHook {}
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct FileChooserHookResult {
256 #[prost(string, tag = "1")]
257 pub file_chooser_id: ::prost::alloc::string::String,
258 #[prost(bool, tag = "2")]
259 pub is_multiple: bool,
260 #[prost(string, tag = "3")]
261 pub note: ::prost::alloc::string::String,
262}
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct SetFileChooserFilesCommand {
265 #[prost(string, tag = "1")]
266 pub file_chooser_id: ::prost::alloc::string::String,
267 #[prost(string, repeated, tag = "2")]
268 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
269 #[prost(message, optional, tag = "3")]
270 pub retry_options: ::core::option::Option<CommandRetryOptions>,
271}
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct FileChooserFilesSetEvent {
274 #[prost(string, tag = "1")]
275 pub file_chooser_id: ::prost::alloc::string::String,
276 #[prost(string, repeated, tag = "2")]
277 pub file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
278 #[prost(string, tag = "3")]
279 pub note: ::prost::alloc::string::String,
280}
281#[derive(Clone, Copy, PartialEq, ::prost::Message)]
282pub struct RegisterDownloadHook {}
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct DownloadHookResult {
285 #[prost(string, tag = "1")]
286 pub download_id: ::prost::alloc::string::String,
287 #[prost(string, tag = "2")]
288 pub url: ::prost::alloc::string::String,
289 #[prost(string, tag = "3")]
290 pub suggested_filename: ::prost::alloc::string::String,
291 #[prost(string, tag = "4")]
292 pub note: ::prost::alloc::string::String,
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct SaveDownloadCommand {
296 #[prost(string, tag = "1")]
297 pub download_id: ::prost::alloc::string::String,
298 #[prost(message, optional, tag = "2")]
299 pub retry_options: ::core::option::Option<CommandRetryOptions>,
300}
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct DownloadSavedEvent {
303 #[prost(string, tag = "1")]
304 pub download_id: ::prost::alloc::string::String,
305 #[prost(string, tag = "2")]
306 pub file_id: ::prost::alloc::string::String,
307 #[prost(string, tag = "3")]
308 pub suggested_filename: ::prost::alloc::string::String,
309 #[prost(uint64, tag = "4")]
310 pub size: u64,
311 #[prost(string, tag = "5")]
312 pub note: ::prost::alloc::string::String,
313}
314#[derive(Clone, PartialEq, ::prost::Message)]
316pub struct ResolveFrameCommand {
317 #[prost(string, tag = "1")]
318 pub css_selector: ::prost::alloc::string::String,
319 #[prost(message, optional, tag = "2")]
320 pub retry_options: ::core::option::Option<CommandRetryOptions>,
321}
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct FrameResolvedEvent {
324 #[prost(string, tag = "1")]
325 pub context_session_id: ::prost::alloc::string::String,
326}
327#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
328#[repr(i32)]
329pub enum BrowserKind {
330 Unspecified = 0,
331 Chromium = 1,
332 Firefox = 2,
333}
334impl BrowserKind {
335 pub fn as_str_name(&self) -> &'static str {
340 match self {
341 Self::Unspecified => "BROWSER_KIND_UNSPECIFIED",
342 Self::Chromium => "BROWSER_KIND_CHROMIUM",
343 Self::Firefox => "BROWSER_KIND_FIREFOX",
344 }
345 }
346 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
348 match value {
349 "BROWSER_KIND_UNSPECIFIED" => Some(Self::Unspecified),
350 "BROWSER_KIND_CHROMIUM" => Some(Self::Chromium),
351 "BROWSER_KIND_FIREFOX" => Some(Self::Firefox),
352 _ => None,
353 }
354 }
355}
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct SurfaceSessionCommand {
358 #[prost(oneof = "surface_session_command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
359 pub command: ::core::option::Option<surface_session_command::Command>,
360}
361pub mod surface_session_command {
363 #[derive(Clone, PartialEq, ::prost::Oneof)]
364 pub enum Command {
365 #[prost(message, tag = "1")]
366 LaunchChrome(super::LaunchChromeCommand),
367 #[prost(message, tag = "2")]
368 OpenContext(super::OpenContextCommand),
369 #[prost(message, tag = "3")]
370 Ping(super::SessionPingCommand),
371 #[prost(message, tag = "4")]
372 Close(super::CloseSurfaceSessionCommand),
373 #[prost(message, tag = "5")]
374 LaunchBrowser(super::LaunchBrowserCommand),
375 #[prost(message, tag = "6")]
376 ConnectMobile(super::ConnectMobileCommand),
377 #[prost(message, tag = "7")]
378 LaunchApp(super::LaunchAppCommand),
379 }
380}
381#[derive(Clone, Copy, PartialEq, ::prost::Message)]
382pub struct OpenContextCommand {
383 #[prost(message, optional, tag = "1")]
384 pub retry_options: ::core::option::Option<CommandRetryOptions>,
385}
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct SessionPingCommand {
388 #[prost(string, tag = "1")]
389 pub message: ::prost::alloc::string::String,
390}
391#[derive(Clone, Copy, PartialEq, ::prost::Message)]
392pub struct CloseSurfaceSessionCommand {}
393#[derive(Clone, PartialEq, ::prost::Message)]
394pub struct SurfaceSessionEvent {
395 #[prost(string, tag = "1")]
396 pub session_id: ::prost::alloc::string::String,
397 #[prost(oneof = "surface_session_event::Event", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
398 pub event: ::core::option::Option<surface_session_event::Event>,
399}
400pub mod surface_session_event {
402 #[derive(Clone, PartialEq, ::prost::Oneof)]
403 pub enum Event {
404 #[prost(message, tag = "2")]
405 ChromeLaunched(super::ChromeLaunchedEvent),
406 #[prost(message, tag = "3")]
407 ContextOpened(super::ContextOpenedEvent),
408 #[prost(message, tag = "4")]
409 Pong(super::SessionPongEvent),
410 #[prost(message, tag = "5")]
411 Closed(super::SurfaceSessionClosedEvent),
412 #[prost(message, tag = "6")]
413 Error(super::SurfaceSessionErrorEvent),
414 #[prost(message, tag = "7")]
415 BrowserLaunched(super::BrowserLaunchedEvent),
416 #[prost(message, tag = "8")]
417 MobileConnected(super::MobileConnectedEvent),
418 #[prost(message, tag = "9")]
419 AppLaunched(super::AppLaunchedEvent),
420 }
421}
422#[derive(Clone, PartialEq, ::prost::Message)]
423pub struct ContextOpenedEvent {
424 #[prost(string, tag = "1")]
425 pub context_session_id: ::prost::alloc::string::String,
426 #[prost(string, tag = "2")]
427 pub note: ::prost::alloc::string::String,
428}
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct SessionPongEvent {
431 #[prost(string, tag = "1")]
432 pub message: ::prost::alloc::string::String,
433}
434#[derive(Clone, PartialEq, ::prost::Message)]
435pub struct SurfaceSessionClosedEvent {
436 #[prost(string, tag = "1")]
437 pub reason: ::prost::alloc::string::String,
438}
439#[derive(Clone, PartialEq, ::prost::Message)]
440pub struct SurfaceSessionErrorEvent {
441 #[prost(string, tag = "1")]
442 pub message: ::prost::alloc::string::String,
443}
444#[derive(Clone, PartialEq, ::prost::Message)]
445pub struct ContextSessionCommand {
446 #[prost(string, tag = "1")]
447 pub surface_session_id: ::prost::alloc::string::String,
448 #[prost(string, tag = "2")]
449 pub context_session_id: ::prost::alloc::string::String,
450 #[prost(
451 oneof = "context_session_command::Command",
452 tags = "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"
453 )]
454 pub command: ::core::option::Option<context_session_command::Command>,
455}
456pub mod context_session_command {
458 #[derive(Clone, PartialEq, ::prost::Oneof)]
459 pub enum Command {
460 #[prost(message, tag = "3")]
461 Ping(super::ContextSessionPingCommand),
462 #[prost(message, tag = "4")]
463 Close(super::CloseContextSessionCommand),
464 #[prost(message, tag = "5")]
465 Navigate(super::NavigatePageCommand),
466 #[prost(message, tag = "6")]
467 ClickElement(super::ClickElementCommand),
468 #[prost(message, tag = "7")]
469 CountElements(super::CountElementsCommand),
470 #[prost(message, tag = "8")]
471 HighlightElements(super::HighlightElementsCommand),
472 #[prost(message, tag = "9")]
473 FocusElement(super::FocusElementCommand),
474 #[prost(message, tag = "10")]
475 FillElement(super::FillElementCommand),
476 #[prost(message, tag = "11")]
477 HoverElement(super::HoverElementCommand),
478 #[prost(message, tag = "12")]
479 PressKey(super::PressKeyCommand),
480 #[prost(message, tag = "13")]
481 GetTextContent(super::GetTextContentCommand),
482 #[prost(message, tag = "14")]
483 GetInnerText(super::GetInnerTextCommand),
484 #[prost(message, tag = "15")]
485 WaitForSelector(super::WaitForSelectorCommand),
486 #[prost(message, tag = "16")]
487 Screenshot(super::ScreenshotCommand),
488 #[prost(message, tag = "17")]
489 AccessibilitySnapshot(super::AccessibilitySnapshotCommand),
490 #[prost(message, tag = "18")]
491 RegisterHook(super::RegisterHookCommand),
492 #[prost(message, tag = "19")]
493 WaitForHook(super::WaitForHookCommand),
494 #[prost(message, tag = "20")]
495 SetFileChooserFiles(super::SetFileChooserFilesCommand),
496 #[prost(message, tag = "21")]
497 SaveDownload(super::SaveDownloadCommand),
498 #[prost(message, tag = "22")]
499 UploadFileChunk(super::UploadFileChunkCommand),
500 #[prost(message, tag = "23")]
501 ReadFileChunk(super::ReadFileChunkCommand),
502 #[prost(message, tag = "24")]
503 SetMobileFileChooserFiles(super::SetMobileFileChooserFilesCommand),
504 #[prost(message, tag = "25")]
505 SaveMobileDownload(super::SaveMobileDownloadCommand),
506 #[prost(message, tag = "26")]
507 ResolveFrame(super::ResolveFrameCommand),
508 #[prost(message, tag = "27")]
509 Capture(super::CaptureCommand),
510 }
511}
512#[derive(Clone, PartialEq, ::prost::Message)]
513pub struct ContextSessionPingCommand {
514 #[prost(string, tag = "1")]
515 pub message: ::prost::alloc::string::String,
516}
517#[derive(Clone, Copy, PartialEq, ::prost::Message)]
518pub struct CloseContextSessionCommand {}
519#[derive(Clone, PartialEq, ::prost::Message)]
520pub struct ContextSessionEvent {
521 #[prost(string, tag = "1")]
522 pub context_session_id: ::prost::alloc::string::String,
523 #[prost(
524 oneof = "context_session_event::Event",
525 tags = "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"
526 )]
527 pub event: ::core::option::Option<context_session_event::Event>,
528}
529pub mod context_session_event {
531 #[derive(Clone, PartialEq, ::prost::Oneof)]
532 pub enum Event {
533 #[prost(message, tag = "2")]
534 Attached(super::ContextSessionAttachedEvent),
535 #[prost(message, tag = "3")]
536 Pong(super::ContextSessionPongEvent),
537 #[prost(message, tag = "4")]
538 Closed(super::ContextSessionClosedEvent),
539 #[prost(message, tag = "5")]
540 Error(super::ContextSessionErrorEvent),
541 #[prost(message, tag = "6")]
542 Navigated(super::PageNavigatedEvent),
543 #[prost(message, tag = "7")]
544 ChromiumBidiInjection(super::ChromiumBidiInjectionEvent),
545 #[prost(message, tag = "8")]
546 ElementClicked(super::ElementClickedEvent),
547 #[prost(message, tag = "9")]
548 ElementCounted(super::ElementCountedEvent),
549 #[prost(message, tag = "10")]
550 ElementsHighlighted(super::ElementsHighlightedEvent),
551 #[prost(message, tag = "11")]
552 ElementFocused(super::ElementFocusedEvent),
553 #[prost(message, tag = "12")]
554 ElementFilled(super::ElementFilledEvent),
555 #[prost(message, tag = "13")]
556 ElementHovered(super::ElementHoveredEvent),
557 #[prost(message, tag = "14")]
558 KeyPressed(super::KeyPressedEvent),
559 #[prost(message, tag = "15")]
560 TextContentResolved(super::TextContentResolvedEvent),
561 #[prost(message, tag = "16")]
562 InnerTextResolved(super::InnerTextResolvedEvent),
563 #[prost(message, tag = "17")]
564 SelectorWaitSatisfied(super::SelectorWaitSatisfiedEvent),
565 #[prost(message, tag = "18")]
566 ScreenshotCaptured(super::ScreenshotCapturedEvent),
567 #[prost(message, tag = "19")]
568 AccessibilitySnapshotCaptured(super::AccessibilitySnapshotCapturedEvent),
569 #[prost(message, tag = "20")]
570 HookRegistered(super::HookRegisteredEvent),
571 #[prost(message, tag = "21")]
572 HookCompleted(super::HookCompletedEvent),
573 #[prost(message, tag = "22")]
574 FileChooserFilesSet(super::FileChooserFilesSetEvent),
575 #[prost(message, tag = "23")]
576 DownloadSaved(super::DownloadSavedEvent),
577 #[prost(message, tag = "24")]
578 FileUploaded(super::FileUploadedEvent),
579 #[prost(message, tag = "25")]
580 FileChunk(super::FileChunkEvent),
581 #[prost(message, tag = "26")]
582 MobileFileChooserFilesSet(super::MobileFileChooserFilesSetEvent),
583 #[prost(message, tag = "27")]
584 MobileDownloadSaved(super::MobileDownloadSavedEvent),
585 #[prost(message, tag = "28")]
586 FrameResolved(super::FrameResolvedEvent),
587 #[prost(message, tag = "29")]
588 CaptureResolved(super::CaptureResolvedEvent),
589 }
590}
591#[derive(Clone, PartialEq, ::prost::Message)]
592pub struct ContextSessionAttachedEvent {
593 #[prost(string, tag = "1")]
594 pub note: ::prost::alloc::string::String,
595}
596#[derive(Clone, PartialEq, ::prost::Message)]
597pub struct ContextSessionPongEvent {
598 #[prost(string, tag = "1")]
599 pub message: ::prost::alloc::string::String,
600}
601#[derive(Clone, PartialEq, ::prost::Message)]
602pub struct ContextSessionClosedEvent {
603 #[prost(string, tag = "1")]
604 pub reason: ::prost::alloc::string::String,
605}
606#[derive(Clone, PartialEq, ::prost::Message)]
607pub struct ContextSessionErrorEvent {
608 #[prost(string, tag = "1")]
609 pub message: ::prost::alloc::string::String,
610}
611#[derive(Clone, Copy, PartialEq, ::prost::Message)]
612pub struct RegisterHookCommand {
613 #[prost(oneof = "register_hook_command::Hook", tags = "1, 2, 3, 4, 5")]
614 pub hook: ::core::option::Option<register_hook_command::Hook>,
615}
616pub mod register_hook_command {
618 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
619 pub enum Hook {
620 #[prost(message, tag = "1")]
621 NewPage(super::RegisterNewPageHook),
622 #[prost(message, tag = "2")]
623 FileChooser(super::RegisterFileChooserHook),
624 #[prost(message, tag = "3")]
625 Download(super::RegisterDownloadHook),
626 #[prost(message, tag = "4")]
627 MobileFileChooser(super::RegisterMobileFileChooserHook),
628 #[prost(message, tag = "5")]
629 MobileDownload(super::RegisterMobileDownloadHook),
630 }
631}
632#[derive(Clone, PartialEq, ::prost::Message)]
633pub struct WaitForHookCommand {
634 #[prost(string, tag = "1")]
635 pub hook_id: ::prost::alloc::string::String,
636 #[prost(message, optional, tag = "2")]
637 pub retry_options: ::core::option::Option<CommandRetryOptions>,
638}
639#[derive(Clone, PartialEq, ::prost::Message)]
640pub struct HookRegisteredEvent {
641 #[prost(string, tag = "1")]
642 pub hook_id: ::prost::alloc::string::String,
643}
644#[derive(Clone, PartialEq, ::prost::Message)]
645pub struct HookCompletedEvent {
646 #[prost(string, tag = "1")]
647 pub hook_id: ::prost::alloc::string::String,
648 #[prost(oneof = "hook_completed_event::Result", tags = "2, 3, 4, 5, 6")]
649 pub result: ::core::option::Option<hook_completed_event::Result>,
650}
651pub mod hook_completed_event {
653 #[derive(Clone, PartialEq, ::prost::Oneof)]
654 pub enum Result {
655 #[prost(message, tag = "2")]
656 NewPage(super::NewPageHookResult),
657 #[prost(message, tag = "3")]
658 FileChooser(super::FileChooserHookResult),
659 #[prost(message, tag = "4")]
660 Download(super::DownloadHookResult),
661 #[prost(message, tag = "5")]
662 MobileFileChooser(super::MobileFileChooserHookResult),
663 #[prost(message, tag = "6")]
664 MobileDownload(super::MobileDownloadHookResult),
665 }
666}
667#[derive(Clone, PartialEq, ::prost::Message)]
668pub struct UploadFileChunkCommand {
669 #[prost(string, tag = "1")]
670 pub transfer_id: ::prost::alloc::string::String,
671 #[prost(string, tag = "2")]
672 pub name: ::prost::alloc::string::String,
673 #[prost(uint64, tag = "3")]
674 pub offset: u64,
675 #[prost(bytes = "vec", tag = "4")]
676 pub data: ::prost::alloc::vec::Vec<u8>,
677 #[prost(bool, tag = "5")]
678 pub last: bool,
679}
680#[derive(Clone, PartialEq, ::prost::Message)]
681pub struct FileUploadedEvent {
682 #[prost(string, tag = "1")]
683 pub transfer_id: ::prost::alloc::string::String,
684 #[prost(string, tag = "2")]
685 pub file_id: ::prost::alloc::string::String,
686 #[prost(string, tag = "3")]
687 pub name: ::prost::alloc::string::String,
688 #[prost(uint64, tag = "4")]
689 pub size: u64,
690}
691#[derive(Clone, PartialEq, ::prost::Message)]
692pub struct ReadFileChunkCommand {
693 #[prost(string, tag = "1")]
694 pub file_id: ::prost::alloc::string::String,
695 #[prost(uint64, tag = "2")]
696 pub offset: u64,
697 #[prost(uint32, tag = "3")]
698 pub max_bytes: u32,
699}
700#[derive(Clone, PartialEq, ::prost::Message)]
701pub struct FileChunkEvent {
702 #[prost(string, tag = "1")]
703 pub file_id: ::prost::alloc::string::String,
704 #[prost(uint64, tag = "2")]
705 pub offset: u64,
706 #[prost(bytes = "vec", tag = "3")]
707 pub data: ::prost::alloc::vec::Vec<u8>,
708 #[prost(bool, tag = "4")]
709 pub last: bool,
710}
711#[derive(Clone, PartialEq, ::prost::Message)]
712pub struct NavigatePageCommand {
713 #[prost(string, tag = "1")]
714 pub url: ::prost::alloc::string::String,
715 #[prost(message, optional, tag = "2")]
716 pub retry_options: ::core::option::Option<CommandRetryOptions>,
717}
718#[derive(Clone, PartialEq, ::prost::Message)]
719pub struct ClickElementCommand {
720 #[prost(string, tag = "1")]
721 pub css_selector: ::prost::alloc::string::String,
722 #[prost(message, optional, tag = "2")]
723 pub retry_options: ::core::option::Option<CommandRetryOptions>,
724}
725#[derive(Clone, PartialEq, ::prost::Message)]
726pub struct CountElementsCommand {
727 #[prost(string, tag = "1")]
728 pub css_selector: ::prost::alloc::string::String,
729 #[prost(message, optional, tag = "2")]
730 pub retry_options: ::core::option::Option<CommandRetryOptions>,
731}
732#[derive(Clone, PartialEq, ::prost::Message)]
733pub struct HighlightElementsCommand {
734 #[prost(string, tag = "1")]
735 pub css_selector: ::prost::alloc::string::String,
736 #[prost(uint32, optional, tag = "2")]
737 pub duration_ms: ::core::option::Option<u32>,
738 #[prost(message, optional, tag = "3")]
739 pub retry_options: ::core::option::Option<CommandRetryOptions>,
740}
741#[derive(Clone, PartialEq, ::prost::Message)]
742pub struct FocusElementCommand {
743 #[prost(string, tag = "1")]
744 pub css_selector: ::prost::alloc::string::String,
745 #[prost(message, optional, tag = "2")]
746 pub retry_options: ::core::option::Option<CommandRetryOptions>,
747}
748#[derive(Clone, PartialEq, ::prost::Message)]
749pub struct FillElementCommand {
750 #[prost(string, tag = "1")]
751 pub css_selector: ::prost::alloc::string::String,
752 #[prost(string, tag = "2")]
753 pub value: ::prost::alloc::string::String,
754 #[prost(message, optional, tag = "3")]
755 pub retry_options: ::core::option::Option<CommandRetryOptions>,
756}
757#[derive(Clone, PartialEq, ::prost::Message)]
758pub struct HoverElementCommand {
759 #[prost(string, tag = "1")]
760 pub css_selector: ::prost::alloc::string::String,
761 #[prost(message, optional, tag = "2")]
762 pub retry_options: ::core::option::Option<CommandRetryOptions>,
763}
764#[derive(Clone, PartialEq, ::prost::Message)]
765pub struct PressKeyCommand {
766 #[prost(string, tag = "1")]
767 pub css_selector: ::prost::alloc::string::String,
768 #[prost(string, tag = "2")]
769 pub key: ::prost::alloc::string::String,
770 #[prost(string, optional, tag = "3")]
771 pub text: ::core::option::Option<::prost::alloc::string::String>,
772 #[prost(message, optional, tag = "4")]
773 pub retry_options: ::core::option::Option<CommandRetryOptions>,
774}
775#[derive(Clone, PartialEq, ::prost::Message)]
776pub struct GetTextContentCommand {
777 #[prost(string, tag = "1")]
778 pub css_selector: ::prost::alloc::string::String,
779 #[prost(message, optional, tag = "2")]
780 pub retry_options: ::core::option::Option<CommandRetryOptions>,
781}
782#[derive(Clone, PartialEq, ::prost::Message)]
783pub struct GetInnerTextCommand {
784 #[prost(string, tag = "1")]
785 pub css_selector: ::prost::alloc::string::String,
786 #[prost(message, optional, tag = "2")]
787 pub retry_options: ::core::option::Option<CommandRetryOptions>,
788}
789#[derive(Clone, PartialEq, ::prost::Message)]
790pub struct WaitForSelectorCommand {
791 #[prost(string, tag = "1")]
792 pub css_selector: ::prost::alloc::string::String,
793 #[prost(bool, optional, tag = "2")]
794 pub visible: ::core::option::Option<bool>,
795 #[prost(message, optional, tag = "3")]
796 pub retry_options: ::core::option::Option<CommandRetryOptions>,
797}
798#[derive(Clone, Copy, PartialEq, ::prost::Message)]
799pub struct ScreenshotCommand {
800 #[prost(message, optional, tag = "1")]
801 pub retry_options: ::core::option::Option<CommandRetryOptions>,
802 #[prost(bool, optional, tag = "2")]
803 pub full_page: ::core::option::Option<bool>,
804}
805#[derive(Clone, PartialEq, ::prost::Message)]
806pub struct PageNavigatedEvent {
807 #[prost(string, tag = "1")]
808 pub url: ::prost::alloc::string::String,
809 #[prost(string, tag = "2")]
810 pub note: ::prost::alloc::string::String,
811}
812#[derive(Clone, PartialEq, ::prost::Message)]
813pub struct ChromiumBidiInjectionEvent {
814 #[prost(string, tag = "1")]
815 pub note: ::prost::alloc::string::String,
816 #[prost(string, tag = "2")]
817 pub bidi_session_id: ::prost::alloc::string::String,
818 #[prost(string, tag = "3")]
819 pub mapper_target_id: ::prost::alloc::string::String,
820 #[prost(string, tag = "4")]
821 pub mapper_session_id: ::prost::alloc::string::String,
822 #[prost(string, tag = "5")]
823 pub package_version: ::prost::alloc::string::String,
824}
825#[derive(Clone, PartialEq, ::prost::Message)]
826pub struct ElementClickedEvent {
827 #[prost(string, tag = "1")]
828 pub css_selector: ::prost::alloc::string::String,
829 #[prost(string, tag = "2")]
830 pub note: ::prost::alloc::string::String,
831 #[prost(string, tag = "3")]
832 pub bidi_session_id: ::prost::alloc::string::String,
833}
834#[derive(Clone, PartialEq, ::prost::Message)]
835pub struct ElementCountedEvent {
836 #[prost(string, tag = "1")]
837 pub css_selector: ::prost::alloc::string::String,
838 #[prost(uint32, tag = "2")]
839 pub count: u32,
840 #[prost(string, tag = "3")]
841 pub note: ::prost::alloc::string::String,
842}
843#[derive(Clone, PartialEq, ::prost::Message)]
844pub struct ElementsHighlightedEvent {
845 #[prost(string, tag = "1")]
846 pub css_selector: ::prost::alloc::string::String,
847 #[prost(uint32, tag = "2")]
848 pub count: u32,
849 #[prost(string, tag = "3")]
850 pub note: ::prost::alloc::string::String,
851}
852#[derive(Clone, PartialEq, ::prost::Message)]
853pub struct ElementFocusedEvent {
854 #[prost(string, tag = "1")]
855 pub css_selector: ::prost::alloc::string::String,
856 #[prost(string, tag = "2")]
857 pub note: ::prost::alloc::string::String,
858}
859#[derive(Clone, PartialEq, ::prost::Message)]
860pub struct ElementFilledEvent {
861 #[prost(string, tag = "1")]
862 pub css_selector: ::prost::alloc::string::String,
863 #[prost(string, tag = "2")]
864 pub value: ::prost::alloc::string::String,
865 #[prost(string, tag = "3")]
866 pub note: ::prost::alloc::string::String,
867}
868#[derive(Clone, PartialEq, ::prost::Message)]
869pub struct ElementHoveredEvent {
870 #[prost(string, tag = "1")]
871 pub css_selector: ::prost::alloc::string::String,
872 #[prost(string, tag = "2")]
873 pub note: ::prost::alloc::string::String,
874}
875#[derive(Clone, PartialEq, ::prost::Message)]
876pub struct KeyPressedEvent {
877 #[prost(string, tag = "1")]
878 pub css_selector: ::prost::alloc::string::String,
879 #[prost(string, tag = "2")]
880 pub key: ::prost::alloc::string::String,
881 #[prost(string, tag = "3")]
882 pub note: ::prost::alloc::string::String,
883}
884#[derive(Clone, PartialEq, ::prost::Message)]
885pub struct TextContentResolvedEvent {
886 #[prost(string, tag = "1")]
887 pub css_selector: ::prost::alloc::string::String,
888 #[prost(string, tag = "2")]
889 pub text: ::prost::alloc::string::String,
890 #[prost(string, tag = "3")]
891 pub note: ::prost::alloc::string::String,
892}
893#[derive(Clone, PartialEq, ::prost::Message)]
894pub struct InnerTextResolvedEvent {
895 #[prost(string, tag = "1")]
896 pub css_selector: ::prost::alloc::string::String,
897 #[prost(string, tag = "2")]
898 pub text: ::prost::alloc::string::String,
899 #[prost(string, tag = "3")]
900 pub note: ::prost::alloc::string::String,
901}
902#[derive(Clone, PartialEq, ::prost::Message)]
903pub struct SelectorWaitSatisfiedEvent {
904 #[prost(string, tag = "1")]
905 pub css_selector: ::prost::alloc::string::String,
906 #[prost(bool, tag = "2")]
907 pub visible: bool,
908 #[prost(string, tag = "3")]
909 pub note: ::prost::alloc::string::String,
910}
911#[derive(Clone, PartialEq, ::prost::Message)]
912pub struct ScreenshotCapturedEvent {
913 #[prost(bytes = "vec", tag = "1")]
914 pub png_data: ::prost::alloc::vec::Vec<u8>,
915 #[prost(string, tag = "2")]
916 pub note: ::prost::alloc::string::String,
917}
918#[derive(Clone, PartialEq, ::prost::Message)]
920pub struct AccessibilitySnapshotCommand {
921 #[prost(string, tag = "3")]
924 pub mode: ::prost::alloc::string::String,
925 #[prost(string, tag = "1")]
926 pub format: ::prost::alloc::string::String,
927 #[prost(message, optional, tag = "2")]
928 pub retry_options: ::core::option::Option<CommandRetryOptions>,
929}
930#[derive(Clone, PartialEq, ::prost::Message)]
932pub struct AccessibilitySnapshotCapturedEvent {
933 #[prost(string, tag = "1")]
934 pub snapshot: ::prost::alloc::string::String,
935 #[prost(string, tag = "2")]
936 pub format: ::prost::alloc::string::String,
937}
938#[derive(Clone, PartialEq, ::prost::Message)]
939pub struct CaptureCommand {
940 #[prost(enumeration = "CaptureKind", tag = "1")]
941 pub kind: i32,
942 #[prost(string, tag = "2")]
943 pub css_selector: ::prost::alloc::string::String,
944 #[prost(string, tag = "3")]
945 pub attribute_name: ::prost::alloc::string::String,
946 #[prost(message, optional, tag = "4")]
947 pub retry_options: ::core::option::Option<CommandRetryOptions>,
948}
949#[derive(Clone, PartialEq, ::prost::Message)]
950pub struct CapturedOption {
951 #[prost(string, tag = "1")]
952 pub value: ::prost::alloc::string::String,
953 #[prost(string, tag = "2")]
954 pub label: ::prost::alloc::string::String,
955 #[prost(uint32, tag = "3")]
956 pub index: u32,
957}
958#[derive(Clone, Copy, PartialEq, ::prost::Message)]
959pub struct BoundingBox {
960 #[prost(double, tag = "1")]
961 pub x: f64,
962 #[prost(double, tag = "2")]
963 pub y: f64,
964 #[prost(double, tag = "3")]
965 pub width: f64,
966 #[prost(double, tag = "4")]
967 pub height: f64,
968}
969#[derive(Clone, PartialEq, ::prost::Message)]
970pub struct CaptureResolvedEvent {
971 #[prost(string, optional, tag = "1")]
973 pub value: ::core::option::Option<::prost::alloc::string::String>,
974 #[prost(bool, optional, tag = "2")]
975 pub checked: ::core::option::Option<bool>,
976 #[prost(message, repeated, tag = "3")]
977 pub selected_options: ::prost::alloc::vec::Vec<CapturedOption>,
978 #[prost(message, optional, tag = "4")]
980 pub bounding_box: ::core::option::Option<BoundingBox>,
981}
982#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
984#[repr(i32)]
985pub enum CaptureKind {
986 Unspecified = 0,
987 Url = 1,
988 InputValue = 2,
989 SelectedOptions = 3,
990 SelectedText = 4,
991 Checked = 5,
992 Attribute = 6,
993 BoundingBox = 7,
994}
995impl CaptureKind {
996 pub fn as_str_name(&self) -> &'static str {
1001 match self {
1002 Self::Unspecified => "CAPTURE_KIND_UNSPECIFIED",
1003 Self::Url => "CAPTURE_KIND_URL",
1004 Self::InputValue => "CAPTURE_KIND_INPUT_VALUE",
1005 Self::SelectedOptions => "CAPTURE_KIND_SELECTED_OPTIONS",
1006 Self::SelectedText => "CAPTURE_KIND_SELECTED_TEXT",
1007 Self::Checked => "CAPTURE_KIND_CHECKED",
1008 Self::Attribute => "CAPTURE_KIND_ATTRIBUTE",
1009 Self::BoundingBox => "CAPTURE_KIND_BOUNDING_BOX",
1010 }
1011 }
1012 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1014 match value {
1015 "CAPTURE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
1016 "CAPTURE_KIND_URL" => Some(Self::Url),
1017 "CAPTURE_KIND_INPUT_VALUE" => Some(Self::InputValue),
1018 "CAPTURE_KIND_SELECTED_OPTIONS" => Some(Self::SelectedOptions),
1019 "CAPTURE_KIND_SELECTED_TEXT" => Some(Self::SelectedText),
1020 "CAPTURE_KIND_CHECKED" => Some(Self::Checked),
1021 "CAPTURE_KIND_ATTRIBUTE" => Some(Self::Attribute),
1022 "CAPTURE_KIND_BOUNDING_BOX" => Some(Self::BoundingBox),
1023 _ => None,
1024 }
1025 }
1026}
1027pub mod engine_service_client {
1029 #![allow(
1030 unused_variables,
1031 dead_code,
1032 missing_docs,
1033 clippy::wildcard_imports,
1034 clippy::let_unit_value,
1035 )]
1036 use tonic::codegen::*;
1037 use tonic::codegen::http::Uri;
1038 #[derive(Debug, Clone)]
1039 pub struct EngineServiceClient<T> {
1040 inner: tonic::client::Grpc<T>,
1041 }
1042 impl EngineServiceClient<tonic::transport::Channel> {
1043 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1045 where
1046 D: TryInto<tonic::transport::Endpoint>,
1047 D::Error: Into<StdError>,
1048 {
1049 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1050 Ok(Self::new(conn))
1051 }
1052 }
1053 impl<T> EngineServiceClient<T>
1054 where
1055 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1056 T::Error: Into<StdError>,
1057 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1058 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1059 {
1060 pub fn new(inner: T) -> Self {
1061 let inner = tonic::client::Grpc::new(inner);
1062 Self { inner }
1063 }
1064 pub fn with_origin(inner: T, origin: Uri) -> Self {
1065 let inner = tonic::client::Grpc::with_origin(inner, origin);
1066 Self { inner }
1067 }
1068 pub fn with_interceptor<F>(
1069 inner: T,
1070 interceptor: F,
1071 ) -> EngineServiceClient<InterceptedService<T, F>>
1072 where
1073 F: tonic::service::Interceptor,
1074 T::ResponseBody: Default,
1075 T: tonic::codegen::Service<
1076 http::Request<tonic::body::BoxBody>,
1077 Response = http::Response<
1078 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1079 >,
1080 >,
1081 <T as tonic::codegen::Service<
1082 http::Request<tonic::body::BoxBody>,
1083 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1084 {
1085 EngineServiceClient::new(InterceptedService::new(inner, interceptor))
1086 }
1087 #[must_use]
1092 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1093 self.inner = self.inner.send_compressed(encoding);
1094 self
1095 }
1096 #[must_use]
1098 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1099 self.inner = self.inner.accept_compressed(encoding);
1100 self
1101 }
1102 #[must_use]
1106 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1107 self.inner = self.inner.max_decoding_message_size(limit);
1108 self
1109 }
1110 #[must_use]
1114 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1115 self.inner = self.inner.max_encoding_message_size(limit);
1116 self
1117 }
1118 pub async fn ping(
1119 &mut self,
1120 request: impl tonic::IntoRequest<super::PingRequest>,
1121 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
1122 self.inner
1123 .ready()
1124 .await
1125 .map_err(|e| {
1126 tonic::Status::unknown(
1127 format!("Service was not ready: {}", e.into()),
1128 )
1129 })?;
1130 let codec = tonic::codec::ProstCodec::default();
1131 let path = http::uri::PathAndQuery::from_static(
1132 "/allwright.engine.v1.EngineService/Ping",
1133 );
1134 let mut req = request.into_request();
1135 req.extensions_mut()
1136 .insert(GrpcMethod::new("allwright.engine.v1.EngineService", "Ping"));
1137 self.inner.unary(req, path, codec).await
1138 }
1139 pub async fn surface_session(
1140 &mut self,
1141 request: impl tonic::IntoStreamingRequest<
1142 Message = super::SurfaceSessionCommand,
1143 >,
1144 ) -> std::result::Result<
1145 tonic::Response<tonic::codec::Streaming<super::SurfaceSessionEvent>>,
1146 tonic::Status,
1147 > {
1148 self.inner
1149 .ready()
1150 .await
1151 .map_err(|e| {
1152 tonic::Status::unknown(
1153 format!("Service was not ready: {}", e.into()),
1154 )
1155 })?;
1156 let codec = tonic::codec::ProstCodec::default();
1157 let path = http::uri::PathAndQuery::from_static(
1158 "/allwright.engine.v1.EngineService/SurfaceSession",
1159 );
1160 let mut req = request.into_streaming_request();
1161 req.extensions_mut()
1162 .insert(
1163 GrpcMethod::new(
1164 "allwright.engine.v1.EngineService",
1165 "SurfaceSession",
1166 ),
1167 );
1168 self.inner.streaming(req, path, codec).await
1169 }
1170 pub async fn context_session(
1171 &mut self,
1172 request: impl tonic::IntoStreamingRequest<
1173 Message = super::ContextSessionCommand,
1174 >,
1175 ) -> std::result::Result<
1176 tonic::Response<tonic::codec::Streaming<super::ContextSessionEvent>>,
1177 tonic::Status,
1178 > {
1179 self.inner
1180 .ready()
1181 .await
1182 .map_err(|e| {
1183 tonic::Status::unknown(
1184 format!("Service was not ready: {}", e.into()),
1185 )
1186 })?;
1187 let codec = tonic::codec::ProstCodec::default();
1188 let path = http::uri::PathAndQuery::from_static(
1189 "/allwright.engine.v1.EngineService/ContextSession",
1190 );
1191 let mut req = request.into_streaming_request();
1192 req.extensions_mut()
1193 .insert(
1194 GrpcMethod::new(
1195 "allwright.engine.v1.EngineService",
1196 "ContextSession",
1197 ),
1198 );
1199 self.inner.streaming(req, path, codec).await
1200 }
1201 }
1202}
1203pub mod engine_service_server {
1205 #![allow(
1206 unused_variables,
1207 dead_code,
1208 missing_docs,
1209 clippy::wildcard_imports,
1210 clippy::let_unit_value,
1211 )]
1212 use tonic::codegen::*;
1213 #[async_trait]
1215 pub trait EngineService: std::marker::Send + std::marker::Sync + 'static {
1216 async fn ping(
1217 &self,
1218 request: tonic::Request<super::PingRequest>,
1219 ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status>;
1220 type SurfaceSessionStream: tonic::codegen::tokio_stream::Stream<
1222 Item = std::result::Result<super::SurfaceSessionEvent, tonic::Status>,
1223 >
1224 + std::marker::Send
1225 + 'static;
1226 async fn surface_session(
1227 &self,
1228 request: tonic::Request<tonic::Streaming<super::SurfaceSessionCommand>>,
1229 ) -> std::result::Result<
1230 tonic::Response<Self::SurfaceSessionStream>,
1231 tonic::Status,
1232 >;
1233 type ContextSessionStream: tonic::codegen::tokio_stream::Stream<
1235 Item = std::result::Result<super::ContextSessionEvent, tonic::Status>,
1236 >
1237 + std::marker::Send
1238 + 'static;
1239 async fn context_session(
1240 &self,
1241 request: tonic::Request<tonic::Streaming<super::ContextSessionCommand>>,
1242 ) -> std::result::Result<
1243 tonic::Response<Self::ContextSessionStream>,
1244 tonic::Status,
1245 >;
1246 }
1247 #[derive(Debug)]
1248 pub struct EngineServiceServer<T> {
1249 inner: Arc<T>,
1250 accept_compression_encodings: EnabledCompressionEncodings,
1251 send_compression_encodings: EnabledCompressionEncodings,
1252 max_decoding_message_size: Option<usize>,
1253 max_encoding_message_size: Option<usize>,
1254 }
1255 impl<T> EngineServiceServer<T> {
1256 pub fn new(inner: T) -> Self {
1257 Self::from_arc(Arc::new(inner))
1258 }
1259 pub fn from_arc(inner: Arc<T>) -> Self {
1260 Self {
1261 inner,
1262 accept_compression_encodings: Default::default(),
1263 send_compression_encodings: Default::default(),
1264 max_decoding_message_size: None,
1265 max_encoding_message_size: None,
1266 }
1267 }
1268 pub fn with_interceptor<F>(
1269 inner: T,
1270 interceptor: F,
1271 ) -> InterceptedService<Self, F>
1272 where
1273 F: tonic::service::Interceptor,
1274 {
1275 InterceptedService::new(Self::new(inner), interceptor)
1276 }
1277 #[must_use]
1279 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1280 self.accept_compression_encodings.enable(encoding);
1281 self
1282 }
1283 #[must_use]
1285 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1286 self.send_compression_encodings.enable(encoding);
1287 self
1288 }
1289 #[must_use]
1293 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1294 self.max_decoding_message_size = Some(limit);
1295 self
1296 }
1297 #[must_use]
1301 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1302 self.max_encoding_message_size = Some(limit);
1303 self
1304 }
1305 }
1306 impl<T, B> tonic::codegen::Service<http::Request<B>> for EngineServiceServer<T>
1307 where
1308 T: EngineService,
1309 B: Body + std::marker::Send + 'static,
1310 B::Error: Into<StdError> + std::marker::Send + 'static,
1311 {
1312 type Response = http::Response<tonic::body::BoxBody>;
1313 type Error = std::convert::Infallible;
1314 type Future = BoxFuture<Self::Response, Self::Error>;
1315 fn poll_ready(
1316 &mut self,
1317 _cx: &mut Context<'_>,
1318 ) -> Poll<std::result::Result<(), Self::Error>> {
1319 Poll::Ready(Ok(()))
1320 }
1321 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1322 match req.uri().path() {
1323 "/allwright.engine.v1.EngineService/Ping" => {
1324 #[allow(non_camel_case_types)]
1325 struct PingSvc<T: EngineService>(pub Arc<T>);
1326 impl<
1327 T: EngineService,
1328 > tonic::server::UnaryService<super::PingRequest> for PingSvc<T> {
1329 type Response = super::PingResponse;
1330 type Future = BoxFuture<
1331 tonic::Response<Self::Response>,
1332 tonic::Status,
1333 >;
1334 fn call(
1335 &mut self,
1336 request: tonic::Request<super::PingRequest>,
1337 ) -> Self::Future {
1338 let inner = Arc::clone(&self.0);
1339 let fut = async move {
1340 <T as EngineService>::ping(&inner, request).await
1341 };
1342 Box::pin(fut)
1343 }
1344 }
1345 let accept_compression_encodings = self.accept_compression_encodings;
1346 let send_compression_encodings = self.send_compression_encodings;
1347 let max_decoding_message_size = self.max_decoding_message_size;
1348 let max_encoding_message_size = self.max_encoding_message_size;
1349 let inner = self.inner.clone();
1350 let fut = async move {
1351 let method = PingSvc(inner);
1352 let codec = tonic::codec::ProstCodec::default();
1353 let mut grpc = tonic::server::Grpc::new(codec)
1354 .apply_compression_config(
1355 accept_compression_encodings,
1356 send_compression_encodings,
1357 )
1358 .apply_max_message_size_config(
1359 max_decoding_message_size,
1360 max_encoding_message_size,
1361 );
1362 let res = grpc.unary(method, req).await;
1363 Ok(res)
1364 };
1365 Box::pin(fut)
1366 }
1367 "/allwright.engine.v1.EngineService/SurfaceSession" => {
1368 #[allow(non_camel_case_types)]
1369 struct SurfaceSessionSvc<T: EngineService>(pub Arc<T>);
1370 impl<
1371 T: EngineService,
1372 > tonic::server::StreamingService<super::SurfaceSessionCommand>
1373 for SurfaceSessionSvc<T> {
1374 type Response = super::SurfaceSessionEvent;
1375 type ResponseStream = T::SurfaceSessionStream;
1376 type Future = BoxFuture<
1377 tonic::Response<Self::ResponseStream>,
1378 tonic::Status,
1379 >;
1380 fn call(
1381 &mut self,
1382 request: tonic::Request<
1383 tonic::Streaming<super::SurfaceSessionCommand>,
1384 >,
1385 ) -> Self::Future {
1386 let inner = Arc::clone(&self.0);
1387 let fut = async move {
1388 <T as EngineService>::surface_session(&inner, request).await
1389 };
1390 Box::pin(fut)
1391 }
1392 }
1393 let accept_compression_encodings = self.accept_compression_encodings;
1394 let send_compression_encodings = self.send_compression_encodings;
1395 let max_decoding_message_size = self.max_decoding_message_size;
1396 let max_encoding_message_size = self.max_encoding_message_size;
1397 let inner = self.inner.clone();
1398 let fut = async move {
1399 let method = SurfaceSessionSvc(inner);
1400 let codec = tonic::codec::ProstCodec::default();
1401 let mut grpc = tonic::server::Grpc::new(codec)
1402 .apply_compression_config(
1403 accept_compression_encodings,
1404 send_compression_encodings,
1405 )
1406 .apply_max_message_size_config(
1407 max_decoding_message_size,
1408 max_encoding_message_size,
1409 );
1410 let res = grpc.streaming(method, req).await;
1411 Ok(res)
1412 };
1413 Box::pin(fut)
1414 }
1415 "/allwright.engine.v1.EngineService/ContextSession" => {
1416 #[allow(non_camel_case_types)]
1417 struct ContextSessionSvc<T: EngineService>(pub Arc<T>);
1418 impl<
1419 T: EngineService,
1420 > tonic::server::StreamingService<super::ContextSessionCommand>
1421 for ContextSessionSvc<T> {
1422 type Response = super::ContextSessionEvent;
1423 type ResponseStream = T::ContextSessionStream;
1424 type Future = BoxFuture<
1425 tonic::Response<Self::ResponseStream>,
1426 tonic::Status,
1427 >;
1428 fn call(
1429 &mut self,
1430 request: tonic::Request<
1431 tonic::Streaming<super::ContextSessionCommand>,
1432 >,
1433 ) -> Self::Future {
1434 let inner = Arc::clone(&self.0);
1435 let fut = async move {
1436 <T as EngineService>::context_session(&inner, request).await
1437 };
1438 Box::pin(fut)
1439 }
1440 }
1441 let accept_compression_encodings = self.accept_compression_encodings;
1442 let send_compression_encodings = self.send_compression_encodings;
1443 let max_decoding_message_size = self.max_decoding_message_size;
1444 let max_encoding_message_size = self.max_encoding_message_size;
1445 let inner = self.inner.clone();
1446 let fut = async move {
1447 let method = ContextSessionSvc(inner);
1448 let codec = tonic::codec::ProstCodec::default();
1449 let mut grpc = tonic::server::Grpc::new(codec)
1450 .apply_compression_config(
1451 accept_compression_encodings,
1452 send_compression_encodings,
1453 )
1454 .apply_max_message_size_config(
1455 max_decoding_message_size,
1456 max_encoding_message_size,
1457 );
1458 let res = grpc.streaming(method, req).await;
1459 Ok(res)
1460 };
1461 Box::pin(fut)
1462 }
1463 _ => {
1464 Box::pin(async move {
1465 let mut response = http::Response::new(empty_body());
1466 let headers = response.headers_mut();
1467 headers
1468 .insert(
1469 tonic::Status::GRPC_STATUS,
1470 (tonic::Code::Unimplemented as i32).into(),
1471 );
1472 headers
1473 .insert(
1474 http::header::CONTENT_TYPE,
1475 tonic::metadata::GRPC_CONTENT_TYPE,
1476 );
1477 Ok(response)
1478 })
1479 }
1480 }
1481 }
1482 }
1483 impl<T> Clone for EngineServiceServer<T> {
1484 fn clone(&self) -> Self {
1485 let inner = self.inner.clone();
1486 Self {
1487 inner,
1488 accept_compression_encodings: self.accept_compression_encodings,
1489 send_compression_encodings: self.send_compression_encodings,
1490 max_decoding_message_size: self.max_decoding_message_size,
1491 max_encoding_message_size: self.max_encoding_message_size,
1492 }
1493 }
1494 }
1495 pub const SERVICE_NAME: &str = "allwright.engine.v1.EngineService";
1497 impl<T> tonic::server::NamedService for EngineServiceServer<T> {
1498 const NAME: &'static str = SERVICE_NAME;
1499 }
1500}