1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_bluetooth_avrcp_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct PeerManagerGetBrowseControllerForTargetRequest {
16 pub peer_id: fidl_fuchsia_bluetooth::PeerId,
17 pub client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for PeerManagerGetBrowseControllerForTargetRequest
22{
23}
24
25#[derive(Debug, PartialEq)]
26pub struct PeerManagerGetControllerForTargetRequest {
27 pub peer_id: fidl_fuchsia_bluetooth::PeerId,
28 pub client: fidl::endpoints::ServerEnd<ControllerMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for PeerManagerGetControllerForTargetRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct PeerManagerRegisterTargetHandlerRequest {
38 pub handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
39}
40
41impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
42 for PeerManagerRegisterTargetHandlerRequest
43{
44}
45
46#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47pub struct PeerManagerSetAbsoluteVolumeHandlerRequest {
48 pub handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
49}
50
51impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
52 for PeerManagerSetAbsoluteVolumeHandlerRequest
53{
54}
55
56#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
57pub struct AbsoluteVolumeHandlerMarker;
58
59impl fidl::endpoints::ProtocolMarker for AbsoluteVolumeHandlerMarker {
60 type Proxy = AbsoluteVolumeHandlerProxy;
61 type RequestStream = AbsoluteVolumeHandlerRequestStream;
62 #[cfg(target_os = "fuchsia")]
63 type SynchronousProxy = AbsoluteVolumeHandlerSynchronousProxy;
64
65 const DEBUG_NAME: &'static str = "(anonymous) AbsoluteVolumeHandler";
66}
67
68pub trait AbsoluteVolumeHandlerProxyInterface: Send + Sync {
69 type SetVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
70 fn r#set_volume(&self, requested_volume: u8) -> Self::SetVolumeResponseFut;
71 type OnVolumeChangedResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
72 fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut;
73 type GetCurrentVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
74 fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut;
75}
76#[derive(Debug)]
77#[cfg(target_os = "fuchsia")]
78pub struct AbsoluteVolumeHandlerSynchronousProxy {
79 client: fidl::client::sync::Client,
80}
81
82#[cfg(target_os = "fuchsia")]
83impl fidl::endpoints::SynchronousProxy for AbsoluteVolumeHandlerSynchronousProxy {
84 type Proxy = AbsoluteVolumeHandlerProxy;
85 type Protocol = AbsoluteVolumeHandlerMarker;
86
87 fn from_channel(inner: fidl::Channel) -> Self {
88 Self::new(inner)
89 }
90
91 fn into_channel(self) -> fidl::Channel {
92 self.client.into_channel()
93 }
94
95 fn as_channel(&self) -> &fidl::Channel {
96 self.client.as_channel()
97 }
98}
99
100#[cfg(target_os = "fuchsia")]
101impl AbsoluteVolumeHandlerSynchronousProxy {
102 pub fn new(channel: fidl::Channel) -> Self {
103 let protocol_name =
104 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
105 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
106 }
107
108 pub fn into_channel(self) -> fidl::Channel {
109 self.client.into_channel()
110 }
111
112 pub fn wait_for_event(
115 &self,
116 deadline: zx::MonotonicInstant,
117 ) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
118 AbsoluteVolumeHandlerEvent::decode(self.client.wait_for_event(deadline)?)
119 }
120
121 pub fn r#set_volume(
125 &self,
126 mut requested_volume: u8,
127 ___deadline: zx::MonotonicInstant,
128 ) -> Result<u8, fidl::Error> {
129 let _response = self.client.send_query::<
130 AbsoluteVolumeHandlerSetVolumeRequest,
131 AbsoluteVolumeHandlerSetVolumeResponse,
132 >(
133 (requested_volume,),
134 0x2796843ecbdecc65,
135 fidl::encoding::DynamicFlags::empty(),
136 ___deadline,
137 )?;
138 Ok(_response.set_volume)
139 }
140
141 pub fn r#on_volume_changed(
147 &self,
148 ___deadline: zx::MonotonicInstant,
149 ) -> Result<u8, fidl::Error> {
150 let _response = self.client.send_query::<
151 fidl::encoding::EmptyPayload,
152 AbsoluteVolumeHandlerOnVolumeChangedResponse,
153 >(
154 (),
155 0x1a1f9cffd4f2a74,
156 fidl::encoding::DynamicFlags::empty(),
157 ___deadline,
158 )?;
159 Ok(_response.new_volume)
160 }
161
162 pub fn r#get_current_volume(
164 &self,
165 ___deadline: zx::MonotonicInstant,
166 ) -> Result<u8, fidl::Error> {
167 let _response = self.client.send_query::<
168 fidl::encoding::EmptyPayload,
169 AbsoluteVolumeHandlerGetCurrentVolumeResponse,
170 >(
171 (),
172 0x6ae76e0c77ac35ff,
173 fidl::encoding::DynamicFlags::empty(),
174 ___deadline,
175 )?;
176 Ok(_response.volume)
177 }
178}
179
180#[cfg(target_os = "fuchsia")]
181impl From<AbsoluteVolumeHandlerSynchronousProxy> for zx::Handle {
182 fn from(value: AbsoluteVolumeHandlerSynchronousProxy) -> Self {
183 value.into_channel().into()
184 }
185}
186
187#[cfg(target_os = "fuchsia")]
188impl From<fidl::Channel> for AbsoluteVolumeHandlerSynchronousProxy {
189 fn from(value: fidl::Channel) -> Self {
190 Self::new(value)
191 }
192}
193
194#[derive(Debug, Clone)]
195pub struct AbsoluteVolumeHandlerProxy {
196 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
197}
198
199impl fidl::endpoints::Proxy for AbsoluteVolumeHandlerProxy {
200 type Protocol = AbsoluteVolumeHandlerMarker;
201
202 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
203 Self::new(inner)
204 }
205
206 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
207 self.client.into_channel().map_err(|client| Self { client })
208 }
209
210 fn as_channel(&self) -> &::fidl::AsyncChannel {
211 self.client.as_channel()
212 }
213}
214
215impl AbsoluteVolumeHandlerProxy {
216 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
218 let protocol_name =
219 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
220 Self { client: fidl::client::Client::new(channel, protocol_name) }
221 }
222
223 pub fn take_event_stream(&self) -> AbsoluteVolumeHandlerEventStream {
229 AbsoluteVolumeHandlerEventStream { event_receiver: self.client.take_event_receiver() }
230 }
231
232 pub fn r#set_volume(
236 &self,
237 mut requested_volume: u8,
238 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
239 AbsoluteVolumeHandlerProxyInterface::r#set_volume(self, requested_volume)
240 }
241
242 pub fn r#on_volume_changed(
248 &self,
249 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
250 AbsoluteVolumeHandlerProxyInterface::r#on_volume_changed(self)
251 }
252
253 pub fn r#get_current_volume(
255 &self,
256 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
257 AbsoluteVolumeHandlerProxyInterface::r#get_current_volume(self)
258 }
259}
260
261impl AbsoluteVolumeHandlerProxyInterface for AbsoluteVolumeHandlerProxy {
262 type SetVolumeResponseFut =
263 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
264 fn r#set_volume(&self, mut requested_volume: u8) -> Self::SetVolumeResponseFut {
265 fn _decode(
266 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
267 ) -> Result<u8, fidl::Error> {
268 let _response = fidl::client::decode_transaction_body::<
269 AbsoluteVolumeHandlerSetVolumeResponse,
270 fidl::encoding::DefaultFuchsiaResourceDialect,
271 0x2796843ecbdecc65,
272 >(_buf?)?;
273 Ok(_response.set_volume)
274 }
275 self.client.send_query_and_decode::<AbsoluteVolumeHandlerSetVolumeRequest, u8>(
276 (requested_volume,),
277 0x2796843ecbdecc65,
278 fidl::encoding::DynamicFlags::empty(),
279 _decode,
280 )
281 }
282
283 type OnVolumeChangedResponseFut =
284 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
285 fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut {
286 fn _decode(
287 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
288 ) -> Result<u8, fidl::Error> {
289 let _response = fidl::client::decode_transaction_body::<
290 AbsoluteVolumeHandlerOnVolumeChangedResponse,
291 fidl::encoding::DefaultFuchsiaResourceDialect,
292 0x1a1f9cffd4f2a74,
293 >(_buf?)?;
294 Ok(_response.new_volume)
295 }
296 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
297 (),
298 0x1a1f9cffd4f2a74,
299 fidl::encoding::DynamicFlags::empty(),
300 _decode,
301 )
302 }
303
304 type GetCurrentVolumeResponseFut =
305 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
306 fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut {
307 fn _decode(
308 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
309 ) -> Result<u8, fidl::Error> {
310 let _response = fidl::client::decode_transaction_body::<
311 AbsoluteVolumeHandlerGetCurrentVolumeResponse,
312 fidl::encoding::DefaultFuchsiaResourceDialect,
313 0x6ae76e0c77ac35ff,
314 >(_buf?)?;
315 Ok(_response.volume)
316 }
317 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
318 (),
319 0x6ae76e0c77ac35ff,
320 fidl::encoding::DynamicFlags::empty(),
321 _decode,
322 )
323 }
324}
325
326pub struct AbsoluteVolumeHandlerEventStream {
327 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
328}
329
330impl std::marker::Unpin for AbsoluteVolumeHandlerEventStream {}
331
332impl futures::stream::FusedStream for AbsoluteVolumeHandlerEventStream {
333 fn is_terminated(&self) -> bool {
334 self.event_receiver.is_terminated()
335 }
336}
337
338impl futures::Stream for AbsoluteVolumeHandlerEventStream {
339 type Item = Result<AbsoluteVolumeHandlerEvent, fidl::Error>;
340
341 fn poll_next(
342 mut self: std::pin::Pin<&mut Self>,
343 cx: &mut std::task::Context<'_>,
344 ) -> std::task::Poll<Option<Self::Item>> {
345 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
346 &mut self.event_receiver,
347 cx
348 )?) {
349 Some(buf) => std::task::Poll::Ready(Some(AbsoluteVolumeHandlerEvent::decode(buf))),
350 None => std::task::Poll::Ready(None),
351 }
352 }
353}
354
355#[derive(Debug)]
356pub enum AbsoluteVolumeHandlerEvent {}
357
358impl AbsoluteVolumeHandlerEvent {
359 fn decode(
361 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
362 ) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
363 let (bytes, _handles) = buf.split_mut();
364 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
365 debug_assert_eq!(tx_header.tx_id, 0);
366 match tx_header.ordinal {
367 _ => Err(fidl::Error::UnknownOrdinal {
368 ordinal: tx_header.ordinal,
369 protocol_name:
370 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
371 }),
372 }
373 }
374}
375
376pub struct AbsoluteVolumeHandlerRequestStream {
378 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
379 is_terminated: bool,
380}
381
382impl std::marker::Unpin for AbsoluteVolumeHandlerRequestStream {}
383
384impl futures::stream::FusedStream for AbsoluteVolumeHandlerRequestStream {
385 fn is_terminated(&self) -> bool {
386 self.is_terminated
387 }
388}
389
390impl fidl::endpoints::RequestStream for AbsoluteVolumeHandlerRequestStream {
391 type Protocol = AbsoluteVolumeHandlerMarker;
392 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
393
394 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
395 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
396 }
397
398 fn control_handle(&self) -> Self::ControlHandle {
399 AbsoluteVolumeHandlerControlHandle { inner: self.inner.clone() }
400 }
401
402 fn into_inner(
403 self,
404 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
405 {
406 (self.inner, self.is_terminated)
407 }
408
409 fn from_inner(
410 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
411 is_terminated: bool,
412 ) -> Self {
413 Self { inner, is_terminated }
414 }
415}
416
417impl futures::Stream for AbsoluteVolumeHandlerRequestStream {
418 type Item = Result<AbsoluteVolumeHandlerRequest, fidl::Error>;
419
420 fn poll_next(
421 mut self: std::pin::Pin<&mut Self>,
422 cx: &mut std::task::Context<'_>,
423 ) -> std::task::Poll<Option<Self::Item>> {
424 let this = &mut *self;
425 if this.inner.check_shutdown(cx) {
426 this.is_terminated = true;
427 return std::task::Poll::Ready(None);
428 }
429 if this.is_terminated {
430 panic!("polled AbsoluteVolumeHandlerRequestStream after completion");
431 }
432 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
433 |bytes, handles| {
434 match this.inner.channel().read_etc(cx, bytes, handles) {
435 std::task::Poll::Ready(Ok(())) => {}
436 std::task::Poll::Pending => return std::task::Poll::Pending,
437 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
438 this.is_terminated = true;
439 return std::task::Poll::Ready(None);
440 }
441 std::task::Poll::Ready(Err(e)) => {
442 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
443 e.into(),
444 ))))
445 }
446 }
447
448 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
450
451 std::task::Poll::Ready(Some(match header.ordinal {
452 0x2796843ecbdecc65 => {
453 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
454 let mut req = fidl::new_empty!(AbsoluteVolumeHandlerSetVolumeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
455 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AbsoluteVolumeHandlerSetVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
456 let control_handle = AbsoluteVolumeHandlerControlHandle {
457 inner: this.inner.clone(),
458 };
459 Ok(AbsoluteVolumeHandlerRequest::SetVolume {requested_volume: req.requested_volume,
460
461 responder: AbsoluteVolumeHandlerSetVolumeResponder {
462 control_handle: std::mem::ManuallyDrop::new(control_handle),
463 tx_id: header.tx_id,
464 },
465 })
466 }
467 0x1a1f9cffd4f2a74 => {
468 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
469 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
470 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
471 let control_handle = AbsoluteVolumeHandlerControlHandle {
472 inner: this.inner.clone(),
473 };
474 Ok(AbsoluteVolumeHandlerRequest::OnVolumeChanged {
475 responder: AbsoluteVolumeHandlerOnVolumeChangedResponder {
476 control_handle: std::mem::ManuallyDrop::new(control_handle),
477 tx_id: header.tx_id,
478 },
479 })
480 }
481 0x6ae76e0c77ac35ff => {
482 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
483 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
484 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
485 let control_handle = AbsoluteVolumeHandlerControlHandle {
486 inner: this.inner.clone(),
487 };
488 Ok(AbsoluteVolumeHandlerRequest::GetCurrentVolume {
489 responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder {
490 control_handle: std::mem::ManuallyDrop::new(control_handle),
491 tx_id: header.tx_id,
492 },
493 })
494 }
495 _ => Err(fidl::Error::UnknownOrdinal {
496 ordinal: header.ordinal,
497 protocol_name: <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
498 }),
499 }))
500 },
501 )
502 }
503}
504
505#[derive(Debug)]
510pub enum AbsoluteVolumeHandlerRequest {
511 SetVolume { requested_volume: u8, responder: AbsoluteVolumeHandlerSetVolumeResponder },
515 OnVolumeChanged { responder: AbsoluteVolumeHandlerOnVolumeChangedResponder },
521 GetCurrentVolume { responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder },
523}
524
525impl AbsoluteVolumeHandlerRequest {
526 #[allow(irrefutable_let_patterns)]
527 pub fn into_set_volume(self) -> Option<(u8, AbsoluteVolumeHandlerSetVolumeResponder)> {
528 if let AbsoluteVolumeHandlerRequest::SetVolume { requested_volume, responder } = self {
529 Some((requested_volume, responder))
530 } else {
531 None
532 }
533 }
534
535 #[allow(irrefutable_let_patterns)]
536 pub fn into_on_volume_changed(self) -> Option<(AbsoluteVolumeHandlerOnVolumeChangedResponder)> {
537 if let AbsoluteVolumeHandlerRequest::OnVolumeChanged { responder } = self {
538 Some((responder))
539 } else {
540 None
541 }
542 }
543
544 #[allow(irrefutable_let_patterns)]
545 pub fn into_get_current_volume(
546 self,
547 ) -> Option<(AbsoluteVolumeHandlerGetCurrentVolumeResponder)> {
548 if let AbsoluteVolumeHandlerRequest::GetCurrentVolume { responder } = self {
549 Some((responder))
550 } else {
551 None
552 }
553 }
554
555 pub fn method_name(&self) -> &'static str {
557 match *self {
558 AbsoluteVolumeHandlerRequest::SetVolume { .. } => "set_volume",
559 AbsoluteVolumeHandlerRequest::OnVolumeChanged { .. } => "on_volume_changed",
560 AbsoluteVolumeHandlerRequest::GetCurrentVolume { .. } => "get_current_volume",
561 }
562 }
563}
564
565#[derive(Debug, Clone)]
566pub struct AbsoluteVolumeHandlerControlHandle {
567 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
568}
569
570impl fidl::endpoints::ControlHandle for AbsoluteVolumeHandlerControlHandle {
571 fn shutdown(&self) {
572 self.inner.shutdown()
573 }
574 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
575 self.inner.shutdown_with_epitaph(status)
576 }
577
578 fn is_closed(&self) -> bool {
579 self.inner.channel().is_closed()
580 }
581 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
582 self.inner.channel().on_closed()
583 }
584
585 #[cfg(target_os = "fuchsia")]
586 fn signal_peer(
587 &self,
588 clear_mask: zx::Signals,
589 set_mask: zx::Signals,
590 ) -> Result<(), zx_status::Status> {
591 use fidl::Peered;
592 self.inner.channel().signal_peer(clear_mask, set_mask)
593 }
594}
595
596impl AbsoluteVolumeHandlerControlHandle {}
597
598#[must_use = "FIDL methods require a response to be sent"]
599#[derive(Debug)]
600pub struct AbsoluteVolumeHandlerSetVolumeResponder {
601 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
602 tx_id: u32,
603}
604
605impl std::ops::Drop for AbsoluteVolumeHandlerSetVolumeResponder {
609 fn drop(&mut self) {
610 self.control_handle.shutdown();
611 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
613 }
614}
615
616impl fidl::endpoints::Responder for AbsoluteVolumeHandlerSetVolumeResponder {
617 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
618
619 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
620 &self.control_handle
621 }
622
623 fn drop_without_shutdown(mut self) {
624 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
626 std::mem::forget(self);
628 }
629}
630
631impl AbsoluteVolumeHandlerSetVolumeResponder {
632 pub fn send(self, mut set_volume: u8) -> Result<(), fidl::Error> {
636 let _result = self.send_raw(set_volume);
637 if _result.is_err() {
638 self.control_handle.shutdown();
639 }
640 self.drop_without_shutdown();
641 _result
642 }
643
644 pub fn send_no_shutdown_on_err(self, mut set_volume: u8) -> Result<(), fidl::Error> {
646 let _result = self.send_raw(set_volume);
647 self.drop_without_shutdown();
648 _result
649 }
650
651 fn send_raw(&self, mut set_volume: u8) -> Result<(), fidl::Error> {
652 self.control_handle.inner.send::<AbsoluteVolumeHandlerSetVolumeResponse>(
653 (set_volume,),
654 self.tx_id,
655 0x2796843ecbdecc65,
656 fidl::encoding::DynamicFlags::empty(),
657 )
658 }
659}
660
661#[must_use = "FIDL methods require a response to be sent"]
662#[derive(Debug)]
663pub struct AbsoluteVolumeHandlerOnVolumeChangedResponder {
664 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
665 tx_id: u32,
666}
667
668impl std::ops::Drop for AbsoluteVolumeHandlerOnVolumeChangedResponder {
672 fn drop(&mut self) {
673 self.control_handle.shutdown();
674 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
676 }
677}
678
679impl fidl::endpoints::Responder for AbsoluteVolumeHandlerOnVolumeChangedResponder {
680 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
681
682 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
683 &self.control_handle
684 }
685
686 fn drop_without_shutdown(mut self) {
687 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
689 std::mem::forget(self);
691 }
692}
693
694impl AbsoluteVolumeHandlerOnVolumeChangedResponder {
695 pub fn send(self, mut new_volume: u8) -> Result<(), fidl::Error> {
699 let _result = self.send_raw(new_volume);
700 if _result.is_err() {
701 self.control_handle.shutdown();
702 }
703 self.drop_without_shutdown();
704 _result
705 }
706
707 pub fn send_no_shutdown_on_err(self, mut new_volume: u8) -> Result<(), fidl::Error> {
709 let _result = self.send_raw(new_volume);
710 self.drop_without_shutdown();
711 _result
712 }
713
714 fn send_raw(&self, mut new_volume: u8) -> Result<(), fidl::Error> {
715 self.control_handle.inner.send::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(
716 (new_volume,),
717 self.tx_id,
718 0x1a1f9cffd4f2a74,
719 fidl::encoding::DynamicFlags::empty(),
720 )
721 }
722}
723
724#[must_use = "FIDL methods require a response to be sent"]
725#[derive(Debug)]
726pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponder {
727 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
728 tx_id: u32,
729}
730
731impl std::ops::Drop for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
735 fn drop(&mut self) {
736 self.control_handle.shutdown();
737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
739 }
740}
741
742impl fidl::endpoints::Responder for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
743 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
744
745 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
746 &self.control_handle
747 }
748
749 fn drop_without_shutdown(mut self) {
750 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
752 std::mem::forget(self);
754 }
755}
756
757impl AbsoluteVolumeHandlerGetCurrentVolumeResponder {
758 pub fn send(self, mut volume: u8) -> Result<(), fidl::Error> {
762 let _result = self.send_raw(volume);
763 if _result.is_err() {
764 self.control_handle.shutdown();
765 }
766 self.drop_without_shutdown();
767 _result
768 }
769
770 pub fn send_no_shutdown_on_err(self, mut volume: u8) -> Result<(), fidl::Error> {
772 let _result = self.send_raw(volume);
773 self.drop_without_shutdown();
774 _result
775 }
776
777 fn send_raw(&self, mut volume: u8) -> Result<(), fidl::Error> {
778 self.control_handle.inner.send::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(
779 (volume,),
780 self.tx_id,
781 0x6ae76e0c77ac35ff,
782 fidl::encoding::DynamicFlags::empty(),
783 )
784 }
785}
786
787#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
788pub struct BrowseControllerMarker;
789
790impl fidl::endpoints::ProtocolMarker for BrowseControllerMarker {
791 type Proxy = BrowseControllerProxy;
792 type RequestStream = BrowseControllerRequestStream;
793 #[cfg(target_os = "fuchsia")]
794 type SynchronousProxy = BrowseControllerSynchronousProxy;
795
796 const DEBUG_NAME: &'static str = "(anonymous) BrowseController";
797}
798pub type BrowseControllerGetMediaPlayerItemsResult =
799 Result<Vec<MediaPlayerItem>, BrowseControllerError>;
800pub type BrowseControllerGetNowPlayingItemsResult =
801 Result<Vec<MediaElementItem>, BrowseControllerError>;
802pub type BrowseControllerGetFileSystemItemsResult =
803 Result<Vec<FileSystemItem>, BrowseControllerError>;
804pub type BrowseControllerChangePathResult = Result<u32, BrowseControllerError>;
805pub type BrowseControllerPlayFileSystemItemResult = Result<(), BrowseControllerError>;
806pub type BrowseControllerPlayNowPlayingItemResult = Result<(), BrowseControllerError>;
807pub type BrowseControllerSetBrowsedPlayerResult = Result<(), BrowseControllerError>;
808
809pub trait BrowseControllerProxyInterface: Send + Sync {
810 type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error>>
811 + Send;
812 fn r#get_media_player_items(
813 &self,
814 start_index: u32,
815 end_index: u32,
816 ) -> Self::GetMediaPlayerItemsResponseFut;
817 type GetNowPlayingItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error>>
818 + Send;
819 fn r#get_now_playing_items(
820 &self,
821 start_index: u32,
822 end_index: u32,
823 attribute_option: &AttributeRequestOption,
824 ) -> Self::GetNowPlayingItemsResponseFut;
825 type GetFileSystemItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetFileSystemItemsResult, fidl::Error>>
826 + Send;
827 fn r#get_file_system_items(
828 &self,
829 start_index: u32,
830 end_index: u32,
831 attribute_option: &AttributeRequestOption,
832 ) -> Self::GetFileSystemItemsResponseFut;
833 type ChangePathResponseFut: std::future::Future<Output = Result<BrowseControllerChangePathResult, fidl::Error>>
834 + Send;
835 fn r#change_path(&self, path: &Path) -> Self::ChangePathResponseFut;
836 type PlayFileSystemItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayFileSystemItemResult, fidl::Error>>
837 + Send;
838 fn r#play_file_system_item(&self, uid: u64) -> Self::PlayFileSystemItemResponseFut;
839 type PlayNowPlayingItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error>>
840 + Send;
841 fn r#play_now_playing_item(&self, uid: u64) -> Self::PlayNowPlayingItemResponseFut;
842 type SetBrowsedPlayerResponseFut: std::future::Future<Output = Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error>>
843 + Send;
844 fn r#set_browsed_player(&self, player_id: u16) -> Self::SetBrowsedPlayerResponseFut;
845}
846#[derive(Debug)]
847#[cfg(target_os = "fuchsia")]
848pub struct BrowseControllerSynchronousProxy {
849 client: fidl::client::sync::Client,
850}
851
852#[cfg(target_os = "fuchsia")]
853impl fidl::endpoints::SynchronousProxy for BrowseControllerSynchronousProxy {
854 type Proxy = BrowseControllerProxy;
855 type Protocol = BrowseControllerMarker;
856
857 fn from_channel(inner: fidl::Channel) -> Self {
858 Self::new(inner)
859 }
860
861 fn into_channel(self) -> fidl::Channel {
862 self.client.into_channel()
863 }
864
865 fn as_channel(&self) -> &fidl::Channel {
866 self.client.as_channel()
867 }
868}
869
870#[cfg(target_os = "fuchsia")]
871impl BrowseControllerSynchronousProxy {
872 pub fn new(channel: fidl::Channel) -> Self {
873 let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
874 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
875 }
876
877 pub fn into_channel(self) -> fidl::Channel {
878 self.client.into_channel()
879 }
880
881 pub fn wait_for_event(
884 &self,
885 deadline: zx::MonotonicInstant,
886 ) -> Result<BrowseControllerEvent, fidl::Error> {
887 BrowseControllerEvent::decode(self.client.wait_for_event(deadline)?)
888 }
889
890 pub fn r#get_media_player_items(
893 &self,
894 mut start_index: u32,
895 mut end_index: u32,
896 ___deadline: zx::MonotonicInstant,
897 ) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
898 let _response = self
899 .client
900 .send_query::<BrowseControllerGetMediaPlayerItemsRequest, fidl::encoding::ResultType<
901 BrowseControllerGetMediaPlayerItemsResponse,
902 BrowseControllerError,
903 >>(
904 (start_index, end_index),
905 0x49c06d30a9aa02ba,
906 fidl::encoding::DynamicFlags::empty(),
907 ___deadline,
908 )?;
909 Ok(_response.map(|x| x.items))
910 }
911
912 pub fn r#get_now_playing_items(
917 &self,
918 mut start_index: u32,
919 mut end_index: u32,
920 mut attribute_option: &AttributeRequestOption,
921 ___deadline: zx::MonotonicInstant,
922 ) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
923 let _response = self
924 .client
925 .send_query::<BrowseControllerGetNowPlayingItemsRequest, fidl::encoding::ResultType<
926 BrowseControllerGetNowPlayingItemsResponse,
927 BrowseControllerError,
928 >>(
929 (start_index, end_index, attribute_option),
930 0x35f5a88695b46cf7,
931 fidl::encoding::DynamicFlags::empty(),
932 ___deadline,
933 )?;
934 Ok(_response.map(|x| x.items))
935 }
936
937 pub fn r#get_file_system_items(
941 &self,
942 mut start_index: u32,
943 mut end_index: u32,
944 mut attribute_option: &AttributeRequestOption,
945 ___deadline: zx::MonotonicInstant,
946 ) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
947 let _response = self
948 .client
949 .send_query::<BrowseControllerGetFileSystemItemsRequest, fidl::encoding::ResultType<
950 BrowseControllerGetFileSystemItemsResponse,
951 BrowseControllerError,
952 >>(
953 (start_index, end_index, attribute_option),
954 0x5d1415aecee72133,
955 fidl::encoding::DynamicFlags::empty(),
956 ___deadline,
957 )?;
958 Ok(_response.map(|x| x.items))
959 }
960
961 pub fn r#change_path(
966 &self,
967 mut path: &Path,
968 ___deadline: zx::MonotonicInstant,
969 ) -> Result<BrowseControllerChangePathResult, fidl::Error> {
970 let _response =
971 self.client
972 .send_query::<BrowseControllerChangePathRequest, fidl::encoding::ResultType<
973 BrowseControllerChangePathResponse,
974 BrowseControllerError,
975 >>(
976 (path,),
977 0x2e0600579d43b51e,
978 fidl::encoding::DynamicFlags::empty(),
979 ___deadline,
980 )?;
981 Ok(_response.map(|x| x.num_items))
982 }
983
984 pub fn r#play_file_system_item(
986 &self,
987 mut uid: u64,
988 ___deadline: zx::MonotonicInstant,
989 ) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
990 let _response = self.client.send_query::<
991 BrowseControllerPlayFileSystemItemRequest,
992 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
993 >(
994 (uid,),
995 0x57075115ce25cf16,
996 fidl::encoding::DynamicFlags::empty(),
997 ___deadline,
998 )?;
999 Ok(_response.map(|x| x))
1000 }
1001
1002 pub fn r#play_now_playing_item(
1005 &self,
1006 mut uid: u64,
1007 ___deadline: zx::MonotonicInstant,
1008 ) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
1009 let _response = self.client.send_query::<
1010 BrowseControllerPlayNowPlayingItemRequest,
1011 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
1012 >(
1013 (uid,),
1014 0x116e151d547fd2d7,
1015 fidl::encoding::DynamicFlags::empty(),
1016 ___deadline,
1017 )?;
1018 Ok(_response.map(|x| x))
1019 }
1020
1021 pub fn r#set_browsed_player(
1023 &self,
1024 mut player_id: u16,
1025 ___deadline: zx::MonotonicInstant,
1026 ) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
1027 let _response = self.client.send_query::<
1028 BrowseControllerSetBrowsedPlayerRequest,
1029 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
1030 >(
1031 (player_id,),
1032 0x3e3256f57f8848da,
1033 fidl::encoding::DynamicFlags::empty(),
1034 ___deadline,
1035 )?;
1036 Ok(_response.map(|x| x))
1037 }
1038}
1039
1040#[cfg(target_os = "fuchsia")]
1041impl From<BrowseControllerSynchronousProxy> for zx::Handle {
1042 fn from(value: BrowseControllerSynchronousProxy) -> Self {
1043 value.into_channel().into()
1044 }
1045}
1046
1047#[cfg(target_os = "fuchsia")]
1048impl From<fidl::Channel> for BrowseControllerSynchronousProxy {
1049 fn from(value: fidl::Channel) -> Self {
1050 Self::new(value)
1051 }
1052}
1053
1054#[derive(Debug, Clone)]
1055pub struct BrowseControllerProxy {
1056 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1057}
1058
1059impl fidl::endpoints::Proxy for BrowseControllerProxy {
1060 type Protocol = BrowseControllerMarker;
1061
1062 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1063 Self::new(inner)
1064 }
1065
1066 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1067 self.client.into_channel().map_err(|client| Self { client })
1068 }
1069
1070 fn as_channel(&self) -> &::fidl::AsyncChannel {
1071 self.client.as_channel()
1072 }
1073}
1074
1075impl BrowseControllerProxy {
1076 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1078 let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1079 Self { client: fidl::client::Client::new(channel, protocol_name) }
1080 }
1081
1082 pub fn take_event_stream(&self) -> BrowseControllerEventStream {
1088 BrowseControllerEventStream { event_receiver: self.client.take_event_receiver() }
1089 }
1090
1091 pub fn r#get_media_player_items(
1094 &self,
1095 mut start_index: u32,
1096 mut end_index: u32,
1097 ) -> fidl::client::QueryResponseFut<
1098 BrowseControllerGetMediaPlayerItemsResult,
1099 fidl::encoding::DefaultFuchsiaResourceDialect,
1100 > {
1101 BrowseControllerProxyInterface::r#get_media_player_items(self, start_index, end_index)
1102 }
1103
1104 pub fn r#get_now_playing_items(
1109 &self,
1110 mut start_index: u32,
1111 mut end_index: u32,
1112 mut attribute_option: &AttributeRequestOption,
1113 ) -> fidl::client::QueryResponseFut<
1114 BrowseControllerGetNowPlayingItemsResult,
1115 fidl::encoding::DefaultFuchsiaResourceDialect,
1116 > {
1117 BrowseControllerProxyInterface::r#get_now_playing_items(
1118 self,
1119 start_index,
1120 end_index,
1121 attribute_option,
1122 )
1123 }
1124
1125 pub fn r#get_file_system_items(
1129 &self,
1130 mut start_index: u32,
1131 mut end_index: u32,
1132 mut attribute_option: &AttributeRequestOption,
1133 ) -> fidl::client::QueryResponseFut<
1134 BrowseControllerGetFileSystemItemsResult,
1135 fidl::encoding::DefaultFuchsiaResourceDialect,
1136 > {
1137 BrowseControllerProxyInterface::r#get_file_system_items(
1138 self,
1139 start_index,
1140 end_index,
1141 attribute_option,
1142 )
1143 }
1144
1145 pub fn r#change_path(
1150 &self,
1151 mut path: &Path,
1152 ) -> fidl::client::QueryResponseFut<
1153 BrowseControllerChangePathResult,
1154 fidl::encoding::DefaultFuchsiaResourceDialect,
1155 > {
1156 BrowseControllerProxyInterface::r#change_path(self, path)
1157 }
1158
1159 pub fn r#play_file_system_item(
1161 &self,
1162 mut uid: u64,
1163 ) -> fidl::client::QueryResponseFut<
1164 BrowseControllerPlayFileSystemItemResult,
1165 fidl::encoding::DefaultFuchsiaResourceDialect,
1166 > {
1167 BrowseControllerProxyInterface::r#play_file_system_item(self, uid)
1168 }
1169
1170 pub fn r#play_now_playing_item(
1173 &self,
1174 mut uid: u64,
1175 ) -> fidl::client::QueryResponseFut<
1176 BrowseControllerPlayNowPlayingItemResult,
1177 fidl::encoding::DefaultFuchsiaResourceDialect,
1178 > {
1179 BrowseControllerProxyInterface::r#play_now_playing_item(self, uid)
1180 }
1181
1182 pub fn r#set_browsed_player(
1184 &self,
1185 mut player_id: u16,
1186 ) -> fidl::client::QueryResponseFut<
1187 BrowseControllerSetBrowsedPlayerResult,
1188 fidl::encoding::DefaultFuchsiaResourceDialect,
1189 > {
1190 BrowseControllerProxyInterface::r#set_browsed_player(self, player_id)
1191 }
1192}
1193
1194impl BrowseControllerProxyInterface for BrowseControllerProxy {
1195 type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
1196 BrowseControllerGetMediaPlayerItemsResult,
1197 fidl::encoding::DefaultFuchsiaResourceDialect,
1198 >;
1199 fn r#get_media_player_items(
1200 &self,
1201 mut start_index: u32,
1202 mut end_index: u32,
1203 ) -> Self::GetMediaPlayerItemsResponseFut {
1204 fn _decode(
1205 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1206 ) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
1207 let _response = fidl::client::decode_transaction_body::<
1208 fidl::encoding::ResultType<
1209 BrowseControllerGetMediaPlayerItemsResponse,
1210 BrowseControllerError,
1211 >,
1212 fidl::encoding::DefaultFuchsiaResourceDialect,
1213 0x49c06d30a9aa02ba,
1214 >(_buf?)?;
1215 Ok(_response.map(|x| x.items))
1216 }
1217 self.client.send_query_and_decode::<
1218 BrowseControllerGetMediaPlayerItemsRequest,
1219 BrowseControllerGetMediaPlayerItemsResult,
1220 >(
1221 (start_index, end_index,),
1222 0x49c06d30a9aa02ba,
1223 fidl::encoding::DynamicFlags::empty(),
1224 _decode,
1225 )
1226 }
1227
1228 type GetNowPlayingItemsResponseFut = fidl::client::QueryResponseFut<
1229 BrowseControllerGetNowPlayingItemsResult,
1230 fidl::encoding::DefaultFuchsiaResourceDialect,
1231 >;
1232 fn r#get_now_playing_items(
1233 &self,
1234 mut start_index: u32,
1235 mut end_index: u32,
1236 mut attribute_option: &AttributeRequestOption,
1237 ) -> Self::GetNowPlayingItemsResponseFut {
1238 fn _decode(
1239 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1240 ) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
1241 let _response = fidl::client::decode_transaction_body::<
1242 fidl::encoding::ResultType<
1243 BrowseControllerGetNowPlayingItemsResponse,
1244 BrowseControllerError,
1245 >,
1246 fidl::encoding::DefaultFuchsiaResourceDialect,
1247 0x35f5a88695b46cf7,
1248 >(_buf?)?;
1249 Ok(_response.map(|x| x.items))
1250 }
1251 self.client.send_query_and_decode::<
1252 BrowseControllerGetNowPlayingItemsRequest,
1253 BrowseControllerGetNowPlayingItemsResult,
1254 >(
1255 (start_index, end_index, attribute_option,),
1256 0x35f5a88695b46cf7,
1257 fidl::encoding::DynamicFlags::empty(),
1258 _decode,
1259 )
1260 }
1261
1262 type GetFileSystemItemsResponseFut = fidl::client::QueryResponseFut<
1263 BrowseControllerGetFileSystemItemsResult,
1264 fidl::encoding::DefaultFuchsiaResourceDialect,
1265 >;
1266 fn r#get_file_system_items(
1267 &self,
1268 mut start_index: u32,
1269 mut end_index: u32,
1270 mut attribute_option: &AttributeRequestOption,
1271 ) -> Self::GetFileSystemItemsResponseFut {
1272 fn _decode(
1273 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1274 ) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
1275 let _response = fidl::client::decode_transaction_body::<
1276 fidl::encoding::ResultType<
1277 BrowseControllerGetFileSystemItemsResponse,
1278 BrowseControllerError,
1279 >,
1280 fidl::encoding::DefaultFuchsiaResourceDialect,
1281 0x5d1415aecee72133,
1282 >(_buf?)?;
1283 Ok(_response.map(|x| x.items))
1284 }
1285 self.client.send_query_and_decode::<
1286 BrowseControllerGetFileSystemItemsRequest,
1287 BrowseControllerGetFileSystemItemsResult,
1288 >(
1289 (start_index, end_index, attribute_option,),
1290 0x5d1415aecee72133,
1291 fidl::encoding::DynamicFlags::empty(),
1292 _decode,
1293 )
1294 }
1295
1296 type ChangePathResponseFut = fidl::client::QueryResponseFut<
1297 BrowseControllerChangePathResult,
1298 fidl::encoding::DefaultFuchsiaResourceDialect,
1299 >;
1300 fn r#change_path(&self, mut path: &Path) -> Self::ChangePathResponseFut {
1301 fn _decode(
1302 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1303 ) -> Result<BrowseControllerChangePathResult, fidl::Error> {
1304 let _response = fidl::client::decode_transaction_body::<
1305 fidl::encoding::ResultType<
1306 BrowseControllerChangePathResponse,
1307 BrowseControllerError,
1308 >,
1309 fidl::encoding::DefaultFuchsiaResourceDialect,
1310 0x2e0600579d43b51e,
1311 >(_buf?)?;
1312 Ok(_response.map(|x| x.num_items))
1313 }
1314 self.client.send_query_and_decode::<
1315 BrowseControllerChangePathRequest,
1316 BrowseControllerChangePathResult,
1317 >(
1318 (path,),
1319 0x2e0600579d43b51e,
1320 fidl::encoding::DynamicFlags::empty(),
1321 _decode,
1322 )
1323 }
1324
1325 type PlayFileSystemItemResponseFut = fidl::client::QueryResponseFut<
1326 BrowseControllerPlayFileSystemItemResult,
1327 fidl::encoding::DefaultFuchsiaResourceDialect,
1328 >;
1329 fn r#play_file_system_item(&self, mut uid: u64) -> Self::PlayFileSystemItemResponseFut {
1330 fn _decode(
1331 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1332 ) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
1333 let _response = fidl::client::decode_transaction_body::<
1334 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
1335 fidl::encoding::DefaultFuchsiaResourceDialect,
1336 0x57075115ce25cf16,
1337 >(_buf?)?;
1338 Ok(_response.map(|x| x))
1339 }
1340 self.client.send_query_and_decode::<
1341 BrowseControllerPlayFileSystemItemRequest,
1342 BrowseControllerPlayFileSystemItemResult,
1343 >(
1344 (uid,),
1345 0x57075115ce25cf16,
1346 fidl::encoding::DynamicFlags::empty(),
1347 _decode,
1348 )
1349 }
1350
1351 type PlayNowPlayingItemResponseFut = fidl::client::QueryResponseFut<
1352 BrowseControllerPlayNowPlayingItemResult,
1353 fidl::encoding::DefaultFuchsiaResourceDialect,
1354 >;
1355 fn r#play_now_playing_item(&self, mut uid: u64) -> Self::PlayNowPlayingItemResponseFut {
1356 fn _decode(
1357 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1358 ) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
1359 let _response = fidl::client::decode_transaction_body::<
1360 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
1361 fidl::encoding::DefaultFuchsiaResourceDialect,
1362 0x116e151d547fd2d7,
1363 >(_buf?)?;
1364 Ok(_response.map(|x| x))
1365 }
1366 self.client.send_query_and_decode::<
1367 BrowseControllerPlayNowPlayingItemRequest,
1368 BrowseControllerPlayNowPlayingItemResult,
1369 >(
1370 (uid,),
1371 0x116e151d547fd2d7,
1372 fidl::encoding::DynamicFlags::empty(),
1373 _decode,
1374 )
1375 }
1376
1377 type SetBrowsedPlayerResponseFut = fidl::client::QueryResponseFut<
1378 BrowseControllerSetBrowsedPlayerResult,
1379 fidl::encoding::DefaultFuchsiaResourceDialect,
1380 >;
1381 fn r#set_browsed_player(&self, mut player_id: u16) -> Self::SetBrowsedPlayerResponseFut {
1382 fn _decode(
1383 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1384 ) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
1385 let _response = fidl::client::decode_transaction_body::<
1386 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
1387 fidl::encoding::DefaultFuchsiaResourceDialect,
1388 0x3e3256f57f8848da,
1389 >(_buf?)?;
1390 Ok(_response.map(|x| x))
1391 }
1392 self.client.send_query_and_decode::<
1393 BrowseControllerSetBrowsedPlayerRequest,
1394 BrowseControllerSetBrowsedPlayerResult,
1395 >(
1396 (player_id,),
1397 0x3e3256f57f8848da,
1398 fidl::encoding::DynamicFlags::empty(),
1399 _decode,
1400 )
1401 }
1402}
1403
1404pub struct BrowseControllerEventStream {
1405 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1406}
1407
1408impl std::marker::Unpin for BrowseControllerEventStream {}
1409
1410impl futures::stream::FusedStream for BrowseControllerEventStream {
1411 fn is_terminated(&self) -> bool {
1412 self.event_receiver.is_terminated()
1413 }
1414}
1415
1416impl futures::Stream for BrowseControllerEventStream {
1417 type Item = Result<BrowseControllerEvent, fidl::Error>;
1418
1419 fn poll_next(
1420 mut self: std::pin::Pin<&mut Self>,
1421 cx: &mut std::task::Context<'_>,
1422 ) -> std::task::Poll<Option<Self::Item>> {
1423 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1424 &mut self.event_receiver,
1425 cx
1426 )?) {
1427 Some(buf) => std::task::Poll::Ready(Some(BrowseControllerEvent::decode(buf))),
1428 None => std::task::Poll::Ready(None),
1429 }
1430 }
1431}
1432
1433#[derive(Debug)]
1434pub enum BrowseControllerEvent {}
1435
1436impl BrowseControllerEvent {
1437 fn decode(
1439 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1440 ) -> Result<BrowseControllerEvent, fidl::Error> {
1441 let (bytes, _handles) = buf.split_mut();
1442 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1443 debug_assert_eq!(tx_header.tx_id, 0);
1444 match tx_header.ordinal {
1445 _ => Err(fidl::Error::UnknownOrdinal {
1446 ordinal: tx_header.ordinal,
1447 protocol_name:
1448 <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1449 }),
1450 }
1451 }
1452}
1453
1454pub struct BrowseControllerRequestStream {
1456 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1457 is_terminated: bool,
1458}
1459
1460impl std::marker::Unpin for BrowseControllerRequestStream {}
1461
1462impl futures::stream::FusedStream for BrowseControllerRequestStream {
1463 fn is_terminated(&self) -> bool {
1464 self.is_terminated
1465 }
1466}
1467
1468impl fidl::endpoints::RequestStream for BrowseControllerRequestStream {
1469 type Protocol = BrowseControllerMarker;
1470 type ControlHandle = BrowseControllerControlHandle;
1471
1472 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1473 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1474 }
1475
1476 fn control_handle(&self) -> Self::ControlHandle {
1477 BrowseControllerControlHandle { inner: self.inner.clone() }
1478 }
1479
1480 fn into_inner(
1481 self,
1482 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1483 {
1484 (self.inner, self.is_terminated)
1485 }
1486
1487 fn from_inner(
1488 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1489 is_terminated: bool,
1490 ) -> Self {
1491 Self { inner, is_terminated }
1492 }
1493}
1494
1495impl futures::Stream for BrowseControllerRequestStream {
1496 type Item = Result<BrowseControllerRequest, fidl::Error>;
1497
1498 fn poll_next(
1499 mut self: std::pin::Pin<&mut Self>,
1500 cx: &mut std::task::Context<'_>,
1501 ) -> std::task::Poll<Option<Self::Item>> {
1502 let this = &mut *self;
1503 if this.inner.check_shutdown(cx) {
1504 this.is_terminated = true;
1505 return std::task::Poll::Ready(None);
1506 }
1507 if this.is_terminated {
1508 panic!("polled BrowseControllerRequestStream after completion");
1509 }
1510 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1511 |bytes, handles| {
1512 match this.inner.channel().read_etc(cx, bytes, handles) {
1513 std::task::Poll::Ready(Ok(())) => {}
1514 std::task::Poll::Pending => return std::task::Poll::Pending,
1515 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1516 this.is_terminated = true;
1517 return std::task::Poll::Ready(None);
1518 }
1519 std::task::Poll::Ready(Err(e)) => {
1520 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1521 e.into(),
1522 ))))
1523 }
1524 }
1525
1526 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1528
1529 std::task::Poll::Ready(Some(match header.ordinal {
1530 0x49c06d30a9aa02ba => {
1531 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1532 let mut req = fidl::new_empty!(
1533 BrowseControllerGetMediaPlayerItemsRequest,
1534 fidl::encoding::DefaultFuchsiaResourceDialect
1535 );
1536 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetMediaPlayerItemsRequest>(&header, _body_bytes, handles, &mut req)?;
1537 let control_handle =
1538 BrowseControllerControlHandle { inner: this.inner.clone() };
1539 Ok(BrowseControllerRequest::GetMediaPlayerItems {
1540 start_index: req.start_index,
1541 end_index: req.end_index,
1542
1543 responder: BrowseControllerGetMediaPlayerItemsResponder {
1544 control_handle: std::mem::ManuallyDrop::new(control_handle),
1545 tx_id: header.tx_id,
1546 },
1547 })
1548 }
1549 0x35f5a88695b46cf7 => {
1550 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1551 let mut req = fidl::new_empty!(
1552 BrowseControllerGetNowPlayingItemsRequest,
1553 fidl::encoding::DefaultFuchsiaResourceDialect
1554 );
1555 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetNowPlayingItemsRequest>(&header, _body_bytes, handles, &mut req)?;
1556 let control_handle =
1557 BrowseControllerControlHandle { inner: this.inner.clone() };
1558 Ok(BrowseControllerRequest::GetNowPlayingItems {
1559 start_index: req.start_index,
1560 end_index: req.end_index,
1561 attribute_option: req.attribute_option,
1562
1563 responder: BrowseControllerGetNowPlayingItemsResponder {
1564 control_handle: std::mem::ManuallyDrop::new(control_handle),
1565 tx_id: header.tx_id,
1566 },
1567 })
1568 }
1569 0x5d1415aecee72133 => {
1570 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1571 let mut req = fidl::new_empty!(
1572 BrowseControllerGetFileSystemItemsRequest,
1573 fidl::encoding::DefaultFuchsiaResourceDialect
1574 );
1575 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetFileSystemItemsRequest>(&header, _body_bytes, handles, &mut req)?;
1576 let control_handle =
1577 BrowseControllerControlHandle { inner: this.inner.clone() };
1578 Ok(BrowseControllerRequest::GetFileSystemItems {
1579 start_index: req.start_index,
1580 end_index: req.end_index,
1581 attribute_option: req.attribute_option,
1582
1583 responder: BrowseControllerGetFileSystemItemsResponder {
1584 control_handle: std::mem::ManuallyDrop::new(control_handle),
1585 tx_id: header.tx_id,
1586 },
1587 })
1588 }
1589 0x2e0600579d43b51e => {
1590 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1591 let mut req = fidl::new_empty!(
1592 BrowseControllerChangePathRequest,
1593 fidl::encoding::DefaultFuchsiaResourceDialect
1594 );
1595 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerChangePathRequest>(&header, _body_bytes, handles, &mut req)?;
1596 let control_handle =
1597 BrowseControllerControlHandle { inner: this.inner.clone() };
1598 Ok(BrowseControllerRequest::ChangePath {
1599 path: req.path,
1600
1601 responder: BrowseControllerChangePathResponder {
1602 control_handle: std::mem::ManuallyDrop::new(control_handle),
1603 tx_id: header.tx_id,
1604 },
1605 })
1606 }
1607 0x57075115ce25cf16 => {
1608 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1609 let mut req = fidl::new_empty!(
1610 BrowseControllerPlayFileSystemItemRequest,
1611 fidl::encoding::DefaultFuchsiaResourceDialect
1612 );
1613 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayFileSystemItemRequest>(&header, _body_bytes, handles, &mut req)?;
1614 let control_handle =
1615 BrowseControllerControlHandle { inner: this.inner.clone() };
1616 Ok(BrowseControllerRequest::PlayFileSystemItem {
1617 uid: req.uid,
1618
1619 responder: BrowseControllerPlayFileSystemItemResponder {
1620 control_handle: std::mem::ManuallyDrop::new(control_handle),
1621 tx_id: header.tx_id,
1622 },
1623 })
1624 }
1625 0x116e151d547fd2d7 => {
1626 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1627 let mut req = fidl::new_empty!(
1628 BrowseControllerPlayNowPlayingItemRequest,
1629 fidl::encoding::DefaultFuchsiaResourceDialect
1630 );
1631 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayNowPlayingItemRequest>(&header, _body_bytes, handles, &mut req)?;
1632 let control_handle =
1633 BrowseControllerControlHandle { inner: this.inner.clone() };
1634 Ok(BrowseControllerRequest::PlayNowPlayingItem {
1635 uid: req.uid,
1636
1637 responder: BrowseControllerPlayNowPlayingItemResponder {
1638 control_handle: std::mem::ManuallyDrop::new(control_handle),
1639 tx_id: header.tx_id,
1640 },
1641 })
1642 }
1643 0x3e3256f57f8848da => {
1644 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1645 let mut req = fidl::new_empty!(
1646 BrowseControllerSetBrowsedPlayerRequest,
1647 fidl::encoding::DefaultFuchsiaResourceDialect
1648 );
1649 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerSetBrowsedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
1650 let control_handle =
1651 BrowseControllerControlHandle { inner: this.inner.clone() };
1652 Ok(BrowseControllerRequest::SetBrowsedPlayer {
1653 player_id: req.player_id,
1654
1655 responder: BrowseControllerSetBrowsedPlayerResponder {
1656 control_handle: std::mem::ManuallyDrop::new(control_handle),
1657 tx_id: header.tx_id,
1658 },
1659 })
1660 }
1661 _ => Err(fidl::Error::UnknownOrdinal {
1662 ordinal: header.ordinal,
1663 protocol_name:
1664 <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1665 }),
1666 }))
1667 },
1668 )
1669 }
1670}
1671
1672#[derive(Debug)]
1680pub enum BrowseControllerRequest {
1681 GetMediaPlayerItems {
1684 start_index: u32,
1685 end_index: u32,
1686 responder: BrowseControllerGetMediaPlayerItemsResponder,
1687 },
1688 GetNowPlayingItems {
1693 start_index: u32,
1694 end_index: u32,
1695 attribute_option: AttributeRequestOption,
1696 responder: BrowseControllerGetNowPlayingItemsResponder,
1697 },
1698 GetFileSystemItems {
1702 start_index: u32,
1703 end_index: u32,
1704 attribute_option: AttributeRequestOption,
1705 responder: BrowseControllerGetFileSystemItemsResponder,
1706 },
1707 ChangePath { path: Path, responder: BrowseControllerChangePathResponder },
1712 PlayFileSystemItem { uid: u64, responder: BrowseControllerPlayFileSystemItemResponder },
1714 PlayNowPlayingItem { uid: u64, responder: BrowseControllerPlayNowPlayingItemResponder },
1717 SetBrowsedPlayer { player_id: u16, responder: BrowseControllerSetBrowsedPlayerResponder },
1719}
1720
1721impl BrowseControllerRequest {
1722 #[allow(irrefutable_let_patterns)]
1723 pub fn into_get_media_player_items(
1724 self,
1725 ) -> Option<(u32, u32, BrowseControllerGetMediaPlayerItemsResponder)> {
1726 if let BrowseControllerRequest::GetMediaPlayerItems { start_index, end_index, responder } =
1727 self
1728 {
1729 Some((start_index, end_index, responder))
1730 } else {
1731 None
1732 }
1733 }
1734
1735 #[allow(irrefutable_let_patterns)]
1736 pub fn into_get_now_playing_items(
1737 self,
1738 ) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetNowPlayingItemsResponder)>
1739 {
1740 if let BrowseControllerRequest::GetNowPlayingItems {
1741 start_index,
1742 end_index,
1743 attribute_option,
1744 responder,
1745 } = self
1746 {
1747 Some((start_index, end_index, attribute_option, responder))
1748 } else {
1749 None
1750 }
1751 }
1752
1753 #[allow(irrefutable_let_patterns)]
1754 pub fn into_get_file_system_items(
1755 self,
1756 ) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetFileSystemItemsResponder)>
1757 {
1758 if let BrowseControllerRequest::GetFileSystemItems {
1759 start_index,
1760 end_index,
1761 attribute_option,
1762 responder,
1763 } = self
1764 {
1765 Some((start_index, end_index, attribute_option, responder))
1766 } else {
1767 None
1768 }
1769 }
1770
1771 #[allow(irrefutable_let_patterns)]
1772 pub fn into_change_path(self) -> Option<(Path, BrowseControllerChangePathResponder)> {
1773 if let BrowseControllerRequest::ChangePath { path, responder } = self {
1774 Some((path, responder))
1775 } else {
1776 None
1777 }
1778 }
1779
1780 #[allow(irrefutable_let_patterns)]
1781 pub fn into_play_file_system_item(
1782 self,
1783 ) -> Option<(u64, BrowseControllerPlayFileSystemItemResponder)> {
1784 if let BrowseControllerRequest::PlayFileSystemItem { uid, responder } = self {
1785 Some((uid, responder))
1786 } else {
1787 None
1788 }
1789 }
1790
1791 #[allow(irrefutable_let_patterns)]
1792 pub fn into_play_now_playing_item(
1793 self,
1794 ) -> Option<(u64, BrowseControllerPlayNowPlayingItemResponder)> {
1795 if let BrowseControllerRequest::PlayNowPlayingItem { uid, responder } = self {
1796 Some((uid, responder))
1797 } else {
1798 None
1799 }
1800 }
1801
1802 #[allow(irrefutable_let_patterns)]
1803 pub fn into_set_browsed_player(
1804 self,
1805 ) -> Option<(u16, BrowseControllerSetBrowsedPlayerResponder)> {
1806 if let BrowseControllerRequest::SetBrowsedPlayer { player_id, responder } = self {
1807 Some((player_id, responder))
1808 } else {
1809 None
1810 }
1811 }
1812
1813 pub fn method_name(&self) -> &'static str {
1815 match *self {
1816 BrowseControllerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
1817 BrowseControllerRequest::GetNowPlayingItems { .. } => "get_now_playing_items",
1818 BrowseControllerRequest::GetFileSystemItems { .. } => "get_file_system_items",
1819 BrowseControllerRequest::ChangePath { .. } => "change_path",
1820 BrowseControllerRequest::PlayFileSystemItem { .. } => "play_file_system_item",
1821 BrowseControllerRequest::PlayNowPlayingItem { .. } => "play_now_playing_item",
1822 BrowseControllerRequest::SetBrowsedPlayer { .. } => "set_browsed_player",
1823 }
1824 }
1825}
1826
1827#[derive(Debug, Clone)]
1828pub struct BrowseControllerControlHandle {
1829 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1830}
1831
1832impl fidl::endpoints::ControlHandle for BrowseControllerControlHandle {
1833 fn shutdown(&self) {
1834 self.inner.shutdown()
1835 }
1836 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1837 self.inner.shutdown_with_epitaph(status)
1838 }
1839
1840 fn is_closed(&self) -> bool {
1841 self.inner.channel().is_closed()
1842 }
1843 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1844 self.inner.channel().on_closed()
1845 }
1846
1847 #[cfg(target_os = "fuchsia")]
1848 fn signal_peer(
1849 &self,
1850 clear_mask: zx::Signals,
1851 set_mask: zx::Signals,
1852 ) -> Result<(), zx_status::Status> {
1853 use fidl::Peered;
1854 self.inner.channel().signal_peer(clear_mask, set_mask)
1855 }
1856}
1857
1858impl BrowseControllerControlHandle {}
1859
1860#[must_use = "FIDL methods require a response to be sent"]
1861#[derive(Debug)]
1862pub struct BrowseControllerGetMediaPlayerItemsResponder {
1863 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
1864 tx_id: u32,
1865}
1866
1867impl std::ops::Drop for BrowseControllerGetMediaPlayerItemsResponder {
1871 fn drop(&mut self) {
1872 self.control_handle.shutdown();
1873 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1875 }
1876}
1877
1878impl fidl::endpoints::Responder for BrowseControllerGetMediaPlayerItemsResponder {
1879 type ControlHandle = BrowseControllerControlHandle;
1880
1881 fn control_handle(&self) -> &BrowseControllerControlHandle {
1882 &self.control_handle
1883 }
1884
1885 fn drop_without_shutdown(mut self) {
1886 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1888 std::mem::forget(self);
1890 }
1891}
1892
1893impl BrowseControllerGetMediaPlayerItemsResponder {
1894 pub fn send(
1898 self,
1899 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
1900 ) -> Result<(), fidl::Error> {
1901 let _result = self.send_raw(result);
1902 if _result.is_err() {
1903 self.control_handle.shutdown();
1904 }
1905 self.drop_without_shutdown();
1906 _result
1907 }
1908
1909 pub fn send_no_shutdown_on_err(
1911 self,
1912 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
1913 ) -> Result<(), fidl::Error> {
1914 let _result = self.send_raw(result);
1915 self.drop_without_shutdown();
1916 _result
1917 }
1918
1919 fn send_raw(
1920 &self,
1921 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
1922 ) -> Result<(), fidl::Error> {
1923 self.control_handle.inner.send::<fidl::encoding::ResultType<
1924 BrowseControllerGetMediaPlayerItemsResponse,
1925 BrowseControllerError,
1926 >>(
1927 result.map(|items| (items,)),
1928 self.tx_id,
1929 0x49c06d30a9aa02ba,
1930 fidl::encoding::DynamicFlags::empty(),
1931 )
1932 }
1933}
1934
1935#[must_use = "FIDL methods require a response to be sent"]
1936#[derive(Debug)]
1937pub struct BrowseControllerGetNowPlayingItemsResponder {
1938 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
1939 tx_id: u32,
1940}
1941
1942impl std::ops::Drop for BrowseControllerGetNowPlayingItemsResponder {
1946 fn drop(&mut self) {
1947 self.control_handle.shutdown();
1948 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1950 }
1951}
1952
1953impl fidl::endpoints::Responder for BrowseControllerGetNowPlayingItemsResponder {
1954 type ControlHandle = BrowseControllerControlHandle;
1955
1956 fn control_handle(&self) -> &BrowseControllerControlHandle {
1957 &self.control_handle
1958 }
1959
1960 fn drop_without_shutdown(mut self) {
1961 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1963 std::mem::forget(self);
1965 }
1966}
1967
1968impl BrowseControllerGetNowPlayingItemsResponder {
1969 pub fn send(
1973 self,
1974 mut result: Result<&[MediaElementItem], BrowseControllerError>,
1975 ) -> Result<(), fidl::Error> {
1976 let _result = self.send_raw(result);
1977 if _result.is_err() {
1978 self.control_handle.shutdown();
1979 }
1980 self.drop_without_shutdown();
1981 _result
1982 }
1983
1984 pub fn send_no_shutdown_on_err(
1986 self,
1987 mut result: Result<&[MediaElementItem], BrowseControllerError>,
1988 ) -> Result<(), fidl::Error> {
1989 let _result = self.send_raw(result);
1990 self.drop_without_shutdown();
1991 _result
1992 }
1993
1994 fn send_raw(
1995 &self,
1996 mut result: Result<&[MediaElementItem], BrowseControllerError>,
1997 ) -> Result<(), fidl::Error> {
1998 self.control_handle.inner.send::<fidl::encoding::ResultType<
1999 BrowseControllerGetNowPlayingItemsResponse,
2000 BrowseControllerError,
2001 >>(
2002 result.map(|items| (items,)),
2003 self.tx_id,
2004 0x35f5a88695b46cf7,
2005 fidl::encoding::DynamicFlags::empty(),
2006 )
2007 }
2008}
2009
2010#[must_use = "FIDL methods require a response to be sent"]
2011#[derive(Debug)]
2012pub struct BrowseControllerGetFileSystemItemsResponder {
2013 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
2014 tx_id: u32,
2015}
2016
2017impl std::ops::Drop for BrowseControllerGetFileSystemItemsResponder {
2021 fn drop(&mut self) {
2022 self.control_handle.shutdown();
2023 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2025 }
2026}
2027
2028impl fidl::endpoints::Responder for BrowseControllerGetFileSystemItemsResponder {
2029 type ControlHandle = BrowseControllerControlHandle;
2030
2031 fn control_handle(&self) -> &BrowseControllerControlHandle {
2032 &self.control_handle
2033 }
2034
2035 fn drop_without_shutdown(mut self) {
2036 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2038 std::mem::forget(self);
2040 }
2041}
2042
2043impl BrowseControllerGetFileSystemItemsResponder {
2044 pub fn send(
2048 self,
2049 mut result: Result<&[FileSystemItem], BrowseControllerError>,
2050 ) -> Result<(), fidl::Error> {
2051 let _result = self.send_raw(result);
2052 if _result.is_err() {
2053 self.control_handle.shutdown();
2054 }
2055 self.drop_without_shutdown();
2056 _result
2057 }
2058
2059 pub fn send_no_shutdown_on_err(
2061 self,
2062 mut result: Result<&[FileSystemItem], BrowseControllerError>,
2063 ) -> Result<(), fidl::Error> {
2064 let _result = self.send_raw(result);
2065 self.drop_without_shutdown();
2066 _result
2067 }
2068
2069 fn send_raw(
2070 &self,
2071 mut result: Result<&[FileSystemItem], BrowseControllerError>,
2072 ) -> Result<(), fidl::Error> {
2073 self.control_handle.inner.send::<fidl::encoding::ResultType<
2074 BrowseControllerGetFileSystemItemsResponse,
2075 BrowseControllerError,
2076 >>(
2077 result.map(|items| (items,)),
2078 self.tx_id,
2079 0x5d1415aecee72133,
2080 fidl::encoding::DynamicFlags::empty(),
2081 )
2082 }
2083}
2084
2085#[must_use = "FIDL methods require a response to be sent"]
2086#[derive(Debug)]
2087pub struct BrowseControllerChangePathResponder {
2088 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
2089 tx_id: u32,
2090}
2091
2092impl std::ops::Drop for BrowseControllerChangePathResponder {
2096 fn drop(&mut self) {
2097 self.control_handle.shutdown();
2098 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2100 }
2101}
2102
2103impl fidl::endpoints::Responder for BrowseControllerChangePathResponder {
2104 type ControlHandle = BrowseControllerControlHandle;
2105
2106 fn control_handle(&self) -> &BrowseControllerControlHandle {
2107 &self.control_handle
2108 }
2109
2110 fn drop_without_shutdown(mut self) {
2111 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2113 std::mem::forget(self);
2115 }
2116}
2117
2118impl BrowseControllerChangePathResponder {
2119 pub fn send(self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
2123 let _result = self.send_raw(result);
2124 if _result.is_err() {
2125 self.control_handle.shutdown();
2126 }
2127 self.drop_without_shutdown();
2128 _result
2129 }
2130
2131 pub fn send_no_shutdown_on_err(
2133 self,
2134 mut result: Result<u32, BrowseControllerError>,
2135 ) -> Result<(), fidl::Error> {
2136 let _result = self.send_raw(result);
2137 self.drop_without_shutdown();
2138 _result
2139 }
2140
2141 fn send_raw(&self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
2142 self.control_handle.inner.send::<fidl::encoding::ResultType<
2143 BrowseControllerChangePathResponse,
2144 BrowseControllerError,
2145 >>(
2146 result.map(|num_items| (num_items,)),
2147 self.tx_id,
2148 0x2e0600579d43b51e,
2149 fidl::encoding::DynamicFlags::empty(),
2150 )
2151 }
2152}
2153
2154#[must_use = "FIDL methods require a response to be sent"]
2155#[derive(Debug)]
2156pub struct BrowseControllerPlayFileSystemItemResponder {
2157 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
2158 tx_id: u32,
2159}
2160
2161impl std::ops::Drop for BrowseControllerPlayFileSystemItemResponder {
2165 fn drop(&mut self) {
2166 self.control_handle.shutdown();
2167 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2169 }
2170}
2171
2172impl fidl::endpoints::Responder for BrowseControllerPlayFileSystemItemResponder {
2173 type ControlHandle = BrowseControllerControlHandle;
2174
2175 fn control_handle(&self) -> &BrowseControllerControlHandle {
2176 &self.control_handle
2177 }
2178
2179 fn drop_without_shutdown(mut self) {
2180 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2182 std::mem::forget(self);
2184 }
2185}
2186
2187impl BrowseControllerPlayFileSystemItemResponder {
2188 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2192 let _result = self.send_raw(result);
2193 if _result.is_err() {
2194 self.control_handle.shutdown();
2195 }
2196 self.drop_without_shutdown();
2197 _result
2198 }
2199
2200 pub fn send_no_shutdown_on_err(
2202 self,
2203 mut result: Result<(), BrowseControllerError>,
2204 ) -> Result<(), fidl::Error> {
2205 let _result = self.send_raw(result);
2206 self.drop_without_shutdown();
2207 _result
2208 }
2209
2210 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2211 self.control_handle.inner.send::<fidl::encoding::ResultType<
2212 fidl::encoding::EmptyStruct,
2213 BrowseControllerError,
2214 >>(
2215 result,
2216 self.tx_id,
2217 0x57075115ce25cf16,
2218 fidl::encoding::DynamicFlags::empty(),
2219 )
2220 }
2221}
2222
2223#[must_use = "FIDL methods require a response to be sent"]
2224#[derive(Debug)]
2225pub struct BrowseControllerPlayNowPlayingItemResponder {
2226 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
2227 tx_id: u32,
2228}
2229
2230impl std::ops::Drop for BrowseControllerPlayNowPlayingItemResponder {
2234 fn drop(&mut self) {
2235 self.control_handle.shutdown();
2236 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2238 }
2239}
2240
2241impl fidl::endpoints::Responder for BrowseControllerPlayNowPlayingItemResponder {
2242 type ControlHandle = BrowseControllerControlHandle;
2243
2244 fn control_handle(&self) -> &BrowseControllerControlHandle {
2245 &self.control_handle
2246 }
2247
2248 fn drop_without_shutdown(mut self) {
2249 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2251 std::mem::forget(self);
2253 }
2254}
2255
2256impl BrowseControllerPlayNowPlayingItemResponder {
2257 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2261 let _result = self.send_raw(result);
2262 if _result.is_err() {
2263 self.control_handle.shutdown();
2264 }
2265 self.drop_without_shutdown();
2266 _result
2267 }
2268
2269 pub fn send_no_shutdown_on_err(
2271 self,
2272 mut result: Result<(), BrowseControllerError>,
2273 ) -> Result<(), fidl::Error> {
2274 let _result = self.send_raw(result);
2275 self.drop_without_shutdown();
2276 _result
2277 }
2278
2279 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2280 self.control_handle.inner.send::<fidl::encoding::ResultType<
2281 fidl::encoding::EmptyStruct,
2282 BrowseControllerError,
2283 >>(
2284 result,
2285 self.tx_id,
2286 0x116e151d547fd2d7,
2287 fidl::encoding::DynamicFlags::empty(),
2288 )
2289 }
2290}
2291
2292#[must_use = "FIDL methods require a response to be sent"]
2293#[derive(Debug)]
2294pub struct BrowseControllerSetBrowsedPlayerResponder {
2295 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
2296 tx_id: u32,
2297}
2298
2299impl std::ops::Drop for BrowseControllerSetBrowsedPlayerResponder {
2303 fn drop(&mut self) {
2304 self.control_handle.shutdown();
2305 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2307 }
2308}
2309
2310impl fidl::endpoints::Responder for BrowseControllerSetBrowsedPlayerResponder {
2311 type ControlHandle = BrowseControllerControlHandle;
2312
2313 fn control_handle(&self) -> &BrowseControllerControlHandle {
2314 &self.control_handle
2315 }
2316
2317 fn drop_without_shutdown(mut self) {
2318 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2320 std::mem::forget(self);
2322 }
2323}
2324
2325impl BrowseControllerSetBrowsedPlayerResponder {
2326 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2330 let _result = self.send_raw(result);
2331 if _result.is_err() {
2332 self.control_handle.shutdown();
2333 }
2334 self.drop_without_shutdown();
2335 _result
2336 }
2337
2338 pub fn send_no_shutdown_on_err(
2340 self,
2341 mut result: Result<(), BrowseControllerError>,
2342 ) -> Result<(), fidl::Error> {
2343 let _result = self.send_raw(result);
2344 self.drop_without_shutdown();
2345 _result
2346 }
2347
2348 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
2349 self.control_handle.inner.send::<fidl::encoding::ResultType<
2350 fidl::encoding::EmptyStruct,
2351 BrowseControllerError,
2352 >>(
2353 result,
2354 self.tx_id,
2355 0x3e3256f57f8848da,
2356 fidl::encoding::DynamicFlags::empty(),
2357 )
2358 }
2359}
2360
2361#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2362pub struct ControllerMarker;
2363
2364impl fidl::endpoints::ProtocolMarker for ControllerMarker {
2365 type Proxy = ControllerProxy;
2366 type RequestStream = ControllerRequestStream;
2367 #[cfg(target_os = "fuchsia")]
2368 type SynchronousProxy = ControllerSynchronousProxy;
2369
2370 const DEBUG_NAME: &'static str = "(anonymous) Controller";
2371}
2372pub type ControllerGetPlayerApplicationSettingsResult =
2373 Result<PlayerApplicationSettings, ControllerError>;
2374pub type ControllerSetPlayerApplicationSettingsResult =
2375 Result<PlayerApplicationSettings, ControllerError>;
2376pub type ControllerGetMediaAttributesResult = Result<MediaAttributes, ControllerError>;
2377pub type ControllerGetPlayStatusResult = Result<PlayStatus, ControllerError>;
2378pub type ControllerSetAbsoluteVolumeResult = Result<u8, ControllerError>;
2379pub type ControllerInformBatteryStatusResult = Result<(), ControllerError>;
2380pub type ControllerSetAddressedPlayerResult = Result<(), ControllerError>;
2381pub type ControllerSendCommandResult = Result<(), ControllerError>;
2382
2383pub trait ControllerProxyInterface: Send + Sync {
2384 type GetPlayerApplicationSettingsResponseFut: std::future::Future<
2385 Output = Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error>,
2386 > + Send;
2387 fn r#get_player_application_settings(
2388 &self,
2389 attribute_ids: &[PlayerApplicationSettingAttributeId],
2390 ) -> Self::GetPlayerApplicationSettingsResponseFut;
2391 type SetPlayerApplicationSettingsResponseFut: std::future::Future<
2392 Output = Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error>,
2393 > + Send;
2394 fn r#set_player_application_settings(
2395 &self,
2396 requested_settings: &PlayerApplicationSettings,
2397 ) -> Self::SetPlayerApplicationSettingsResponseFut;
2398 type GetMediaAttributesResponseFut: std::future::Future<Output = Result<ControllerGetMediaAttributesResult, fidl::Error>>
2399 + Send;
2400 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
2401 type GetPlayStatusResponseFut: std::future::Future<Output = Result<ControllerGetPlayStatusResult, fidl::Error>>
2402 + Send;
2403 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
2404 type SetAbsoluteVolumeResponseFut: std::future::Future<Output = Result<ControllerSetAbsoluteVolumeResult, fidl::Error>>
2405 + Send;
2406 fn r#set_absolute_volume(&self, requested_volume: u8) -> Self::SetAbsoluteVolumeResponseFut;
2407 type InformBatteryStatusResponseFut: std::future::Future<Output = Result<ControllerInformBatteryStatusResult, fidl::Error>>
2408 + Send;
2409 fn r#inform_battery_status(
2410 &self,
2411 battery_status: BatteryStatus,
2412 ) -> Self::InformBatteryStatusResponseFut;
2413 fn r#set_notification_filter(
2414 &self,
2415 notifications: Notifications,
2416 position_change_interval: u32,
2417 ) -> Result<(), fidl::Error>;
2418 fn r#notify_notification_handled(&self) -> Result<(), fidl::Error>;
2419 type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<ControllerSetAddressedPlayerResult, fidl::Error>>
2420 + Send;
2421 fn r#set_addressed_player(&self, player_id: u16) -> Self::SetAddressedPlayerResponseFut;
2422 type SendCommandResponseFut: std::future::Future<Output = Result<ControllerSendCommandResult, fidl::Error>>
2423 + Send;
2424 fn r#send_command(&self, command: AvcPanelCommand) -> Self::SendCommandResponseFut;
2425}
2426#[derive(Debug)]
2427#[cfg(target_os = "fuchsia")]
2428pub struct ControllerSynchronousProxy {
2429 client: fidl::client::sync::Client,
2430}
2431
2432#[cfg(target_os = "fuchsia")]
2433impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
2434 type Proxy = ControllerProxy;
2435 type Protocol = ControllerMarker;
2436
2437 fn from_channel(inner: fidl::Channel) -> Self {
2438 Self::new(inner)
2439 }
2440
2441 fn into_channel(self) -> fidl::Channel {
2442 self.client.into_channel()
2443 }
2444
2445 fn as_channel(&self) -> &fidl::Channel {
2446 self.client.as_channel()
2447 }
2448}
2449
2450#[cfg(target_os = "fuchsia")]
2451impl ControllerSynchronousProxy {
2452 pub fn new(channel: fidl::Channel) -> Self {
2453 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2454 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2455 }
2456
2457 pub fn into_channel(self) -> fidl::Channel {
2458 self.client.into_channel()
2459 }
2460
2461 pub fn wait_for_event(
2464 &self,
2465 deadline: zx::MonotonicInstant,
2466 ) -> Result<ControllerEvent, fidl::Error> {
2467 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
2468 }
2469
2470 pub fn r#get_player_application_settings(
2474 &self,
2475 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
2476 ___deadline: zx::MonotonicInstant,
2477 ) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
2478 let _response = self
2479 .client
2480 .send_query::<ControllerGetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
2481 ControllerGetPlayerApplicationSettingsResponse,
2482 ControllerError,
2483 >>(
2484 (attribute_ids,),
2485 0x681de2da50670120,
2486 fidl::encoding::DynamicFlags::empty(),
2487 ___deadline,
2488 )?;
2489 Ok(_response.map(|x| x.current_settings))
2490 }
2491
2492 pub fn r#set_player_application_settings(
2499 &self,
2500 mut requested_settings: &PlayerApplicationSettings,
2501 ___deadline: zx::MonotonicInstant,
2502 ) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
2503 let _response = self
2504 .client
2505 .send_query::<ControllerSetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
2506 ControllerSetPlayerApplicationSettingsResponse,
2507 ControllerError,
2508 >>(
2509 (requested_settings,),
2510 0x6a7c9689ea3a589a,
2511 fidl::encoding::DynamicFlags::empty(),
2512 ___deadline,
2513 )?;
2514 Ok(_response.map(|x| x.set_settings))
2515 }
2516
2517 pub fn r#get_media_attributes(
2521 &self,
2522 ___deadline: zx::MonotonicInstant,
2523 ) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
2524 let _response =
2525 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2526 ControllerGetMediaAttributesResponse,
2527 ControllerError,
2528 >>(
2529 (),
2530 0x18bd14308ee3173d,
2531 fidl::encoding::DynamicFlags::empty(),
2532 ___deadline,
2533 )?;
2534 Ok(_response.map(|x| x.attributes))
2535 }
2536
2537 pub fn r#get_play_status(
2539 &self,
2540 ___deadline: zx::MonotonicInstant,
2541 ) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
2542 let _response =
2543 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2544 ControllerGetPlayStatusResponse,
2545 ControllerError,
2546 >>(
2547 (),
2548 0x120735bec709fc6d,
2549 fidl::encoding::DynamicFlags::empty(),
2550 ___deadline,
2551 )?;
2552 Ok(_response.map(|x| x.play_status))
2553 }
2554
2555 pub fn r#set_absolute_volume(
2559 &self,
2560 mut requested_volume: u8,
2561 ___deadline: zx::MonotonicInstant,
2562 ) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
2563 let _response = self.client.send_query::<
2564 ControllerSetAbsoluteVolumeRequest,
2565 fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
2566 >(
2567 (requested_volume,),
2568 0x1b8d010e11d05957,
2569 fidl::encoding::DynamicFlags::empty(),
2570 ___deadline,
2571 )?;
2572 Ok(_response.map(|x| x.set_volume))
2573 }
2574
2575 pub fn r#inform_battery_status(
2577 &self,
2578 mut battery_status: BatteryStatus,
2579 ___deadline: zx::MonotonicInstant,
2580 ) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
2581 let _response = self.client.send_query::<
2582 ControllerInformBatteryStatusRequest,
2583 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
2584 >(
2585 (battery_status,),
2586 0x11d54fbe9d12c44d,
2587 fidl::encoding::DynamicFlags::empty(),
2588 ___deadline,
2589 )?;
2590 Ok(_response.map(|x| x))
2591 }
2592
2593 pub fn r#set_notification_filter(
2603 &self,
2604 mut notifications: Notifications,
2605 mut position_change_interval: u32,
2606 ) -> Result<(), fidl::Error> {
2607 self.client.send::<ControllerSetNotificationFilterRequest>(
2608 (notifications, position_change_interval),
2609 0x4d8a327745ccd73b,
2610 fidl::encoding::DynamicFlags::empty(),
2611 )
2612 }
2613
2614 pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
2616 self.client.send::<fidl::encoding::EmptyPayload>(
2617 (),
2618 0x43d3e556557f3bc2,
2619 fidl::encoding::DynamicFlags::empty(),
2620 )
2621 }
2622
2623 pub fn r#set_addressed_player(
2625 &self,
2626 mut player_id: u16,
2627 ___deadline: zx::MonotonicInstant,
2628 ) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
2629 let _response = self.client.send_query::<
2630 ControllerSetAddressedPlayerRequest,
2631 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
2632 >(
2633 (player_id,),
2634 0x7ffc261f10ee1da5,
2635 fidl::encoding::DynamicFlags::empty(),
2636 ___deadline,
2637 )?;
2638 Ok(_response.map(|x| x))
2639 }
2640
2641 pub fn r#send_command(
2643 &self,
2644 mut command: AvcPanelCommand,
2645 ___deadline: zx::MonotonicInstant,
2646 ) -> Result<ControllerSendCommandResult, fidl::Error> {
2647 let _response = self.client.send_query::<
2648 ControllerSendCommandRequest,
2649 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
2650 >(
2651 (command,),
2652 0x241324c56b5bc257,
2653 fidl::encoding::DynamicFlags::empty(),
2654 ___deadline,
2655 )?;
2656 Ok(_response.map(|x| x))
2657 }
2658}
2659
2660#[cfg(target_os = "fuchsia")]
2661impl From<ControllerSynchronousProxy> for zx::Handle {
2662 fn from(value: ControllerSynchronousProxy) -> Self {
2663 value.into_channel().into()
2664 }
2665}
2666
2667#[cfg(target_os = "fuchsia")]
2668impl From<fidl::Channel> for ControllerSynchronousProxy {
2669 fn from(value: fidl::Channel) -> Self {
2670 Self::new(value)
2671 }
2672}
2673
2674#[derive(Debug, Clone)]
2675pub struct ControllerProxy {
2676 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2677}
2678
2679impl fidl::endpoints::Proxy for ControllerProxy {
2680 type Protocol = ControllerMarker;
2681
2682 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2683 Self::new(inner)
2684 }
2685
2686 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2687 self.client.into_channel().map_err(|client| Self { client })
2688 }
2689
2690 fn as_channel(&self) -> &::fidl::AsyncChannel {
2691 self.client.as_channel()
2692 }
2693}
2694
2695impl ControllerProxy {
2696 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2698 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2699 Self { client: fidl::client::Client::new(channel, protocol_name) }
2700 }
2701
2702 pub fn take_event_stream(&self) -> ControllerEventStream {
2708 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
2709 }
2710
2711 pub fn r#get_player_application_settings(
2715 &self,
2716 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
2717 ) -> fidl::client::QueryResponseFut<
2718 ControllerGetPlayerApplicationSettingsResult,
2719 fidl::encoding::DefaultFuchsiaResourceDialect,
2720 > {
2721 ControllerProxyInterface::r#get_player_application_settings(self, attribute_ids)
2722 }
2723
2724 pub fn r#set_player_application_settings(
2731 &self,
2732 mut requested_settings: &PlayerApplicationSettings,
2733 ) -> fidl::client::QueryResponseFut<
2734 ControllerSetPlayerApplicationSettingsResult,
2735 fidl::encoding::DefaultFuchsiaResourceDialect,
2736 > {
2737 ControllerProxyInterface::r#set_player_application_settings(self, requested_settings)
2738 }
2739
2740 pub fn r#get_media_attributes(
2744 &self,
2745 ) -> fidl::client::QueryResponseFut<
2746 ControllerGetMediaAttributesResult,
2747 fidl::encoding::DefaultFuchsiaResourceDialect,
2748 > {
2749 ControllerProxyInterface::r#get_media_attributes(self)
2750 }
2751
2752 pub fn r#get_play_status(
2754 &self,
2755 ) -> fidl::client::QueryResponseFut<
2756 ControllerGetPlayStatusResult,
2757 fidl::encoding::DefaultFuchsiaResourceDialect,
2758 > {
2759 ControllerProxyInterface::r#get_play_status(self)
2760 }
2761
2762 pub fn r#set_absolute_volume(
2766 &self,
2767 mut requested_volume: u8,
2768 ) -> fidl::client::QueryResponseFut<
2769 ControllerSetAbsoluteVolumeResult,
2770 fidl::encoding::DefaultFuchsiaResourceDialect,
2771 > {
2772 ControllerProxyInterface::r#set_absolute_volume(self, requested_volume)
2773 }
2774
2775 pub fn r#inform_battery_status(
2777 &self,
2778 mut battery_status: BatteryStatus,
2779 ) -> fidl::client::QueryResponseFut<
2780 ControllerInformBatteryStatusResult,
2781 fidl::encoding::DefaultFuchsiaResourceDialect,
2782 > {
2783 ControllerProxyInterface::r#inform_battery_status(self, battery_status)
2784 }
2785
2786 pub fn r#set_notification_filter(
2796 &self,
2797 mut notifications: Notifications,
2798 mut position_change_interval: u32,
2799 ) -> Result<(), fidl::Error> {
2800 ControllerProxyInterface::r#set_notification_filter(
2801 self,
2802 notifications,
2803 position_change_interval,
2804 )
2805 }
2806
2807 pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
2809 ControllerProxyInterface::r#notify_notification_handled(self)
2810 }
2811
2812 pub fn r#set_addressed_player(
2814 &self,
2815 mut player_id: u16,
2816 ) -> fidl::client::QueryResponseFut<
2817 ControllerSetAddressedPlayerResult,
2818 fidl::encoding::DefaultFuchsiaResourceDialect,
2819 > {
2820 ControllerProxyInterface::r#set_addressed_player(self, player_id)
2821 }
2822
2823 pub fn r#send_command(
2825 &self,
2826 mut command: AvcPanelCommand,
2827 ) -> fidl::client::QueryResponseFut<
2828 ControllerSendCommandResult,
2829 fidl::encoding::DefaultFuchsiaResourceDialect,
2830 > {
2831 ControllerProxyInterface::r#send_command(self, command)
2832 }
2833}
2834
2835impl ControllerProxyInterface for ControllerProxy {
2836 type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
2837 ControllerGetPlayerApplicationSettingsResult,
2838 fidl::encoding::DefaultFuchsiaResourceDialect,
2839 >;
2840 fn r#get_player_application_settings(
2841 &self,
2842 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
2843 ) -> Self::GetPlayerApplicationSettingsResponseFut {
2844 fn _decode(
2845 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2846 ) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
2847 let _response = fidl::client::decode_transaction_body::<
2848 fidl::encoding::ResultType<
2849 ControllerGetPlayerApplicationSettingsResponse,
2850 ControllerError,
2851 >,
2852 fidl::encoding::DefaultFuchsiaResourceDialect,
2853 0x681de2da50670120,
2854 >(_buf?)?;
2855 Ok(_response.map(|x| x.current_settings))
2856 }
2857 self.client.send_query_and_decode::<
2858 ControllerGetPlayerApplicationSettingsRequest,
2859 ControllerGetPlayerApplicationSettingsResult,
2860 >(
2861 (attribute_ids,),
2862 0x681de2da50670120,
2863 fidl::encoding::DynamicFlags::empty(),
2864 _decode,
2865 )
2866 }
2867
2868 type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
2869 ControllerSetPlayerApplicationSettingsResult,
2870 fidl::encoding::DefaultFuchsiaResourceDialect,
2871 >;
2872 fn r#set_player_application_settings(
2873 &self,
2874 mut requested_settings: &PlayerApplicationSettings,
2875 ) -> Self::SetPlayerApplicationSettingsResponseFut {
2876 fn _decode(
2877 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2878 ) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
2879 let _response = fidl::client::decode_transaction_body::<
2880 fidl::encoding::ResultType<
2881 ControllerSetPlayerApplicationSettingsResponse,
2882 ControllerError,
2883 >,
2884 fidl::encoding::DefaultFuchsiaResourceDialect,
2885 0x6a7c9689ea3a589a,
2886 >(_buf?)?;
2887 Ok(_response.map(|x| x.set_settings))
2888 }
2889 self.client.send_query_and_decode::<
2890 ControllerSetPlayerApplicationSettingsRequest,
2891 ControllerSetPlayerApplicationSettingsResult,
2892 >(
2893 (requested_settings,),
2894 0x6a7c9689ea3a589a,
2895 fidl::encoding::DynamicFlags::empty(),
2896 _decode,
2897 )
2898 }
2899
2900 type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
2901 ControllerGetMediaAttributesResult,
2902 fidl::encoding::DefaultFuchsiaResourceDialect,
2903 >;
2904 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
2905 fn _decode(
2906 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2907 ) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
2908 let _response = fidl::client::decode_transaction_body::<
2909 fidl::encoding::ResultType<ControllerGetMediaAttributesResponse, ControllerError>,
2910 fidl::encoding::DefaultFuchsiaResourceDialect,
2911 0x18bd14308ee3173d,
2912 >(_buf?)?;
2913 Ok(_response.map(|x| x.attributes))
2914 }
2915 self.client.send_query_and_decode::<
2916 fidl::encoding::EmptyPayload,
2917 ControllerGetMediaAttributesResult,
2918 >(
2919 (),
2920 0x18bd14308ee3173d,
2921 fidl::encoding::DynamicFlags::empty(),
2922 _decode,
2923 )
2924 }
2925
2926 type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
2927 ControllerGetPlayStatusResult,
2928 fidl::encoding::DefaultFuchsiaResourceDialect,
2929 >;
2930 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
2931 fn _decode(
2932 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2933 ) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
2934 let _response = fidl::client::decode_transaction_body::<
2935 fidl::encoding::ResultType<ControllerGetPlayStatusResponse, ControllerError>,
2936 fidl::encoding::DefaultFuchsiaResourceDialect,
2937 0x120735bec709fc6d,
2938 >(_buf?)?;
2939 Ok(_response.map(|x| x.play_status))
2940 }
2941 self.client
2942 .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerGetPlayStatusResult>(
2943 (),
2944 0x120735bec709fc6d,
2945 fidl::encoding::DynamicFlags::empty(),
2946 _decode,
2947 )
2948 }
2949
2950 type SetAbsoluteVolumeResponseFut = fidl::client::QueryResponseFut<
2951 ControllerSetAbsoluteVolumeResult,
2952 fidl::encoding::DefaultFuchsiaResourceDialect,
2953 >;
2954 fn r#set_absolute_volume(
2955 &self,
2956 mut requested_volume: u8,
2957 ) -> Self::SetAbsoluteVolumeResponseFut {
2958 fn _decode(
2959 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2960 ) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
2961 let _response = fidl::client::decode_transaction_body::<
2962 fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
2963 fidl::encoding::DefaultFuchsiaResourceDialect,
2964 0x1b8d010e11d05957,
2965 >(_buf?)?;
2966 Ok(_response.map(|x| x.set_volume))
2967 }
2968 self.client.send_query_and_decode::<
2969 ControllerSetAbsoluteVolumeRequest,
2970 ControllerSetAbsoluteVolumeResult,
2971 >(
2972 (requested_volume,),
2973 0x1b8d010e11d05957,
2974 fidl::encoding::DynamicFlags::empty(),
2975 _decode,
2976 )
2977 }
2978
2979 type InformBatteryStatusResponseFut = fidl::client::QueryResponseFut<
2980 ControllerInformBatteryStatusResult,
2981 fidl::encoding::DefaultFuchsiaResourceDialect,
2982 >;
2983 fn r#inform_battery_status(
2984 &self,
2985 mut battery_status: BatteryStatus,
2986 ) -> Self::InformBatteryStatusResponseFut {
2987 fn _decode(
2988 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2989 ) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
2990 let _response = fidl::client::decode_transaction_body::<
2991 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
2992 fidl::encoding::DefaultFuchsiaResourceDialect,
2993 0x11d54fbe9d12c44d,
2994 >(_buf?)?;
2995 Ok(_response.map(|x| x))
2996 }
2997 self.client.send_query_and_decode::<
2998 ControllerInformBatteryStatusRequest,
2999 ControllerInformBatteryStatusResult,
3000 >(
3001 (battery_status,),
3002 0x11d54fbe9d12c44d,
3003 fidl::encoding::DynamicFlags::empty(),
3004 _decode,
3005 )
3006 }
3007
3008 fn r#set_notification_filter(
3009 &self,
3010 mut notifications: Notifications,
3011 mut position_change_interval: u32,
3012 ) -> Result<(), fidl::Error> {
3013 self.client.send::<ControllerSetNotificationFilterRequest>(
3014 (notifications, position_change_interval),
3015 0x4d8a327745ccd73b,
3016 fidl::encoding::DynamicFlags::empty(),
3017 )
3018 }
3019
3020 fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
3021 self.client.send::<fidl::encoding::EmptyPayload>(
3022 (),
3023 0x43d3e556557f3bc2,
3024 fidl::encoding::DynamicFlags::empty(),
3025 )
3026 }
3027
3028 type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
3029 ControllerSetAddressedPlayerResult,
3030 fidl::encoding::DefaultFuchsiaResourceDialect,
3031 >;
3032 fn r#set_addressed_player(&self, mut player_id: u16) -> Self::SetAddressedPlayerResponseFut {
3033 fn _decode(
3034 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3035 ) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
3036 let _response = fidl::client::decode_transaction_body::<
3037 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
3038 fidl::encoding::DefaultFuchsiaResourceDialect,
3039 0x7ffc261f10ee1da5,
3040 >(_buf?)?;
3041 Ok(_response.map(|x| x))
3042 }
3043 self.client.send_query_and_decode::<
3044 ControllerSetAddressedPlayerRequest,
3045 ControllerSetAddressedPlayerResult,
3046 >(
3047 (player_id,),
3048 0x7ffc261f10ee1da5,
3049 fidl::encoding::DynamicFlags::empty(),
3050 _decode,
3051 )
3052 }
3053
3054 type SendCommandResponseFut = fidl::client::QueryResponseFut<
3055 ControllerSendCommandResult,
3056 fidl::encoding::DefaultFuchsiaResourceDialect,
3057 >;
3058 fn r#send_command(&self, mut command: AvcPanelCommand) -> Self::SendCommandResponseFut {
3059 fn _decode(
3060 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3061 ) -> Result<ControllerSendCommandResult, fidl::Error> {
3062 let _response = fidl::client::decode_transaction_body::<
3063 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
3064 fidl::encoding::DefaultFuchsiaResourceDialect,
3065 0x241324c56b5bc257,
3066 >(_buf?)?;
3067 Ok(_response.map(|x| x))
3068 }
3069 self.client
3070 .send_query_and_decode::<ControllerSendCommandRequest, ControllerSendCommandResult>(
3071 (command,),
3072 0x241324c56b5bc257,
3073 fidl::encoding::DynamicFlags::empty(),
3074 _decode,
3075 )
3076 }
3077}
3078
3079pub struct ControllerEventStream {
3080 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3081}
3082
3083impl std::marker::Unpin for ControllerEventStream {}
3084
3085impl futures::stream::FusedStream for ControllerEventStream {
3086 fn is_terminated(&self) -> bool {
3087 self.event_receiver.is_terminated()
3088 }
3089}
3090
3091impl futures::Stream for ControllerEventStream {
3092 type Item = Result<ControllerEvent, fidl::Error>;
3093
3094 fn poll_next(
3095 mut self: std::pin::Pin<&mut Self>,
3096 cx: &mut std::task::Context<'_>,
3097 ) -> std::task::Poll<Option<Self::Item>> {
3098 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3099 &mut self.event_receiver,
3100 cx
3101 )?) {
3102 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
3103 None => std::task::Poll::Ready(None),
3104 }
3105 }
3106}
3107
3108#[derive(Debug)]
3109pub enum ControllerEvent {
3110 OnNotification { timestamp: i64, notification: Notification },
3111}
3112
3113impl ControllerEvent {
3114 #[allow(irrefutable_let_patterns)]
3115 pub fn into_on_notification(self) -> Option<(i64, Notification)> {
3116 if let ControllerEvent::OnNotification { timestamp, notification } = self {
3117 Some((timestamp, notification))
3118 } else {
3119 None
3120 }
3121 }
3122
3123 fn decode(
3125 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3126 ) -> Result<ControllerEvent, fidl::Error> {
3127 let (bytes, _handles) = buf.split_mut();
3128 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3129 debug_assert_eq!(tx_header.tx_id, 0);
3130 match tx_header.ordinal {
3131 0x796259451db67281 => {
3132 let mut out = fidl::new_empty!(
3133 ControllerOnNotificationRequest,
3134 fidl::encoding::DefaultFuchsiaResourceDialect
3135 );
3136 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerOnNotificationRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3137 Ok((ControllerEvent::OnNotification {
3138 timestamp: out.timestamp,
3139 notification: out.notification,
3140 }))
3141 }
3142 _ => Err(fidl::Error::UnknownOrdinal {
3143 ordinal: tx_header.ordinal,
3144 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3145 }),
3146 }
3147 }
3148}
3149
3150pub struct ControllerRequestStream {
3152 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3153 is_terminated: bool,
3154}
3155
3156impl std::marker::Unpin for ControllerRequestStream {}
3157
3158impl futures::stream::FusedStream for ControllerRequestStream {
3159 fn is_terminated(&self) -> bool {
3160 self.is_terminated
3161 }
3162}
3163
3164impl fidl::endpoints::RequestStream for ControllerRequestStream {
3165 type Protocol = ControllerMarker;
3166 type ControlHandle = ControllerControlHandle;
3167
3168 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3169 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3170 }
3171
3172 fn control_handle(&self) -> Self::ControlHandle {
3173 ControllerControlHandle { inner: self.inner.clone() }
3174 }
3175
3176 fn into_inner(
3177 self,
3178 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3179 {
3180 (self.inner, self.is_terminated)
3181 }
3182
3183 fn from_inner(
3184 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3185 is_terminated: bool,
3186 ) -> Self {
3187 Self { inner, is_terminated }
3188 }
3189}
3190
3191impl futures::Stream for ControllerRequestStream {
3192 type Item = Result<ControllerRequest, fidl::Error>;
3193
3194 fn poll_next(
3195 mut self: std::pin::Pin<&mut Self>,
3196 cx: &mut std::task::Context<'_>,
3197 ) -> std::task::Poll<Option<Self::Item>> {
3198 let this = &mut *self;
3199 if this.inner.check_shutdown(cx) {
3200 this.is_terminated = true;
3201 return std::task::Poll::Ready(None);
3202 }
3203 if this.is_terminated {
3204 panic!("polled ControllerRequestStream after completion");
3205 }
3206 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3207 |bytes, handles| {
3208 match this.inner.channel().read_etc(cx, bytes, handles) {
3209 std::task::Poll::Ready(Ok(())) => {}
3210 std::task::Poll::Pending => return std::task::Poll::Pending,
3211 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3212 this.is_terminated = true;
3213 return std::task::Poll::Ready(None);
3214 }
3215 std::task::Poll::Ready(Err(e)) => {
3216 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3217 e.into(),
3218 ))))
3219 }
3220 }
3221
3222 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3224
3225 std::task::Poll::Ready(Some(match header.ordinal {
3226 0x681de2da50670120 => {
3227 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3228 let mut req = fidl::new_empty!(
3229 ControllerGetPlayerApplicationSettingsRequest,
3230 fidl::encoding::DefaultFuchsiaResourceDialect
3231 );
3232 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
3233 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3234 Ok(ControllerRequest::GetPlayerApplicationSettings {
3235 attribute_ids: req.attribute_ids,
3236
3237 responder: ControllerGetPlayerApplicationSettingsResponder {
3238 control_handle: std::mem::ManuallyDrop::new(control_handle),
3239 tx_id: header.tx_id,
3240 },
3241 })
3242 }
3243 0x6a7c9689ea3a589a => {
3244 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3245 let mut req = fidl::new_empty!(
3246 ControllerSetPlayerApplicationSettingsRequest,
3247 fidl::encoding::DefaultFuchsiaResourceDialect
3248 );
3249 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
3250 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3251 Ok(ControllerRequest::SetPlayerApplicationSettings {
3252 requested_settings: req.requested_settings,
3253
3254 responder: ControllerSetPlayerApplicationSettingsResponder {
3255 control_handle: std::mem::ManuallyDrop::new(control_handle),
3256 tx_id: header.tx_id,
3257 },
3258 })
3259 }
3260 0x18bd14308ee3173d => {
3261 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3262 let mut req = fidl::new_empty!(
3263 fidl::encoding::EmptyPayload,
3264 fidl::encoding::DefaultFuchsiaResourceDialect
3265 );
3266 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3267 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3268 Ok(ControllerRequest::GetMediaAttributes {
3269 responder: ControllerGetMediaAttributesResponder {
3270 control_handle: std::mem::ManuallyDrop::new(control_handle),
3271 tx_id: header.tx_id,
3272 },
3273 })
3274 }
3275 0x120735bec709fc6d => {
3276 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3277 let mut req = fidl::new_empty!(
3278 fidl::encoding::EmptyPayload,
3279 fidl::encoding::DefaultFuchsiaResourceDialect
3280 );
3281 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3282 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3283 Ok(ControllerRequest::GetPlayStatus {
3284 responder: ControllerGetPlayStatusResponder {
3285 control_handle: std::mem::ManuallyDrop::new(control_handle),
3286 tx_id: header.tx_id,
3287 },
3288 })
3289 }
3290 0x1b8d010e11d05957 => {
3291 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3292 let mut req = fidl::new_empty!(
3293 ControllerSetAbsoluteVolumeRequest,
3294 fidl::encoding::DefaultFuchsiaResourceDialect
3295 );
3296 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAbsoluteVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
3297 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3298 Ok(ControllerRequest::SetAbsoluteVolume {
3299 requested_volume: req.requested_volume,
3300
3301 responder: ControllerSetAbsoluteVolumeResponder {
3302 control_handle: std::mem::ManuallyDrop::new(control_handle),
3303 tx_id: header.tx_id,
3304 },
3305 })
3306 }
3307 0x11d54fbe9d12c44d => {
3308 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3309 let mut req = fidl::new_empty!(
3310 ControllerInformBatteryStatusRequest,
3311 fidl::encoding::DefaultFuchsiaResourceDialect
3312 );
3313 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerInformBatteryStatusRequest>(&header, _body_bytes, handles, &mut req)?;
3314 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3315 Ok(ControllerRequest::InformBatteryStatus {
3316 battery_status: req.battery_status,
3317
3318 responder: ControllerInformBatteryStatusResponder {
3319 control_handle: std::mem::ManuallyDrop::new(control_handle),
3320 tx_id: header.tx_id,
3321 },
3322 })
3323 }
3324 0x4d8a327745ccd73b => {
3325 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3326 let mut req = fidl::new_empty!(
3327 ControllerSetNotificationFilterRequest,
3328 fidl::encoding::DefaultFuchsiaResourceDialect
3329 );
3330 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetNotificationFilterRequest>(&header, _body_bytes, handles, &mut req)?;
3331 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3332 Ok(ControllerRequest::SetNotificationFilter {
3333 notifications: req.notifications,
3334 position_change_interval: req.position_change_interval,
3335
3336 control_handle,
3337 })
3338 }
3339 0x43d3e556557f3bc2 => {
3340 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3341 let mut req = fidl::new_empty!(
3342 fidl::encoding::EmptyPayload,
3343 fidl::encoding::DefaultFuchsiaResourceDialect
3344 );
3345 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3346 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3347 Ok(ControllerRequest::NotifyNotificationHandled { control_handle })
3348 }
3349 0x7ffc261f10ee1da5 => {
3350 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3351 let mut req = fidl::new_empty!(
3352 ControllerSetAddressedPlayerRequest,
3353 fidl::encoding::DefaultFuchsiaResourceDialect
3354 );
3355 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
3356 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3357 Ok(ControllerRequest::SetAddressedPlayer {
3358 player_id: req.player_id,
3359
3360 responder: ControllerSetAddressedPlayerResponder {
3361 control_handle: std::mem::ManuallyDrop::new(control_handle),
3362 tx_id: header.tx_id,
3363 },
3364 })
3365 }
3366 0x241324c56b5bc257 => {
3367 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3368 let mut req = fidl::new_empty!(
3369 ControllerSendCommandRequest,
3370 fidl::encoding::DefaultFuchsiaResourceDialect
3371 );
3372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
3373 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
3374 Ok(ControllerRequest::SendCommand {
3375 command: req.command,
3376
3377 responder: ControllerSendCommandResponder {
3378 control_handle: std::mem::ManuallyDrop::new(control_handle),
3379 tx_id: header.tx_id,
3380 },
3381 })
3382 }
3383 _ => Err(fidl::Error::UnknownOrdinal {
3384 ordinal: header.ordinal,
3385 protocol_name:
3386 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3387 }),
3388 }))
3389 },
3390 )
3391 }
3392}
3393
3394#[derive(Debug)]
3400pub enum ControllerRequest {
3401 GetPlayerApplicationSettings {
3405 attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
3406 responder: ControllerGetPlayerApplicationSettingsResponder,
3407 },
3408 SetPlayerApplicationSettings {
3415 requested_settings: PlayerApplicationSettings,
3416 responder: ControllerSetPlayerApplicationSettingsResponder,
3417 },
3418 GetMediaAttributes { responder: ControllerGetMediaAttributesResponder },
3422 GetPlayStatus { responder: ControllerGetPlayStatusResponder },
3424 SetAbsoluteVolume { requested_volume: u8, responder: ControllerSetAbsoluteVolumeResponder },
3428 InformBatteryStatus {
3430 battery_status: BatteryStatus,
3431 responder: ControllerInformBatteryStatusResponder,
3432 },
3433 SetNotificationFilter {
3443 notifications: Notifications,
3444 position_change_interval: u32,
3445 control_handle: ControllerControlHandle,
3446 },
3447 NotifyNotificationHandled { control_handle: ControllerControlHandle },
3449 SetAddressedPlayer { player_id: u16, responder: ControllerSetAddressedPlayerResponder },
3451 SendCommand { command: AvcPanelCommand, responder: ControllerSendCommandResponder },
3453}
3454
3455impl ControllerRequest {
3456 #[allow(irrefutable_let_patterns)]
3457 pub fn into_get_player_application_settings(
3458 self,
3459 ) -> Option<(
3460 Vec<PlayerApplicationSettingAttributeId>,
3461 ControllerGetPlayerApplicationSettingsResponder,
3462 )> {
3463 if let ControllerRequest::GetPlayerApplicationSettings { attribute_ids, responder } = self {
3464 Some((attribute_ids, responder))
3465 } else {
3466 None
3467 }
3468 }
3469
3470 #[allow(irrefutable_let_patterns)]
3471 pub fn into_set_player_application_settings(
3472 self,
3473 ) -> Option<(PlayerApplicationSettings, ControllerSetPlayerApplicationSettingsResponder)> {
3474 if let ControllerRequest::SetPlayerApplicationSettings { requested_settings, responder } =
3475 self
3476 {
3477 Some((requested_settings, responder))
3478 } else {
3479 None
3480 }
3481 }
3482
3483 #[allow(irrefutable_let_patterns)]
3484 pub fn into_get_media_attributes(self) -> Option<(ControllerGetMediaAttributesResponder)> {
3485 if let ControllerRequest::GetMediaAttributes { responder } = self {
3486 Some((responder))
3487 } else {
3488 None
3489 }
3490 }
3491
3492 #[allow(irrefutable_let_patterns)]
3493 pub fn into_get_play_status(self) -> Option<(ControllerGetPlayStatusResponder)> {
3494 if let ControllerRequest::GetPlayStatus { responder } = self {
3495 Some((responder))
3496 } else {
3497 None
3498 }
3499 }
3500
3501 #[allow(irrefutable_let_patterns)]
3502 pub fn into_set_absolute_volume(self) -> Option<(u8, ControllerSetAbsoluteVolumeResponder)> {
3503 if let ControllerRequest::SetAbsoluteVolume { requested_volume, responder } = self {
3504 Some((requested_volume, responder))
3505 } else {
3506 None
3507 }
3508 }
3509
3510 #[allow(irrefutable_let_patterns)]
3511 pub fn into_inform_battery_status(
3512 self,
3513 ) -> Option<(BatteryStatus, ControllerInformBatteryStatusResponder)> {
3514 if let ControllerRequest::InformBatteryStatus { battery_status, responder } = self {
3515 Some((battery_status, responder))
3516 } else {
3517 None
3518 }
3519 }
3520
3521 #[allow(irrefutable_let_patterns)]
3522 pub fn into_set_notification_filter(
3523 self,
3524 ) -> Option<(Notifications, u32, ControllerControlHandle)> {
3525 if let ControllerRequest::SetNotificationFilter {
3526 notifications,
3527 position_change_interval,
3528 control_handle,
3529 } = self
3530 {
3531 Some((notifications, position_change_interval, control_handle))
3532 } else {
3533 None
3534 }
3535 }
3536
3537 #[allow(irrefutable_let_patterns)]
3538 pub fn into_notify_notification_handled(self) -> Option<(ControllerControlHandle)> {
3539 if let ControllerRequest::NotifyNotificationHandled { control_handle } = self {
3540 Some((control_handle))
3541 } else {
3542 None
3543 }
3544 }
3545
3546 #[allow(irrefutable_let_patterns)]
3547 pub fn into_set_addressed_player(self) -> Option<(u16, ControllerSetAddressedPlayerResponder)> {
3548 if let ControllerRequest::SetAddressedPlayer { player_id, responder } = self {
3549 Some((player_id, responder))
3550 } else {
3551 None
3552 }
3553 }
3554
3555 #[allow(irrefutable_let_patterns)]
3556 pub fn into_send_command(self) -> Option<(AvcPanelCommand, ControllerSendCommandResponder)> {
3557 if let ControllerRequest::SendCommand { command, responder } = self {
3558 Some((command, responder))
3559 } else {
3560 None
3561 }
3562 }
3563
3564 pub fn method_name(&self) -> &'static str {
3566 match *self {
3567 ControllerRequest::GetPlayerApplicationSettings { .. } => {
3568 "get_player_application_settings"
3569 }
3570 ControllerRequest::SetPlayerApplicationSettings { .. } => {
3571 "set_player_application_settings"
3572 }
3573 ControllerRequest::GetMediaAttributes { .. } => "get_media_attributes",
3574 ControllerRequest::GetPlayStatus { .. } => "get_play_status",
3575 ControllerRequest::SetAbsoluteVolume { .. } => "set_absolute_volume",
3576 ControllerRequest::InformBatteryStatus { .. } => "inform_battery_status",
3577 ControllerRequest::SetNotificationFilter { .. } => "set_notification_filter",
3578 ControllerRequest::NotifyNotificationHandled { .. } => "notify_notification_handled",
3579 ControllerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
3580 ControllerRequest::SendCommand { .. } => "send_command",
3581 }
3582 }
3583}
3584
3585#[derive(Debug, Clone)]
3586pub struct ControllerControlHandle {
3587 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3588}
3589
3590impl fidl::endpoints::ControlHandle for ControllerControlHandle {
3591 fn shutdown(&self) {
3592 self.inner.shutdown()
3593 }
3594 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3595 self.inner.shutdown_with_epitaph(status)
3596 }
3597
3598 fn is_closed(&self) -> bool {
3599 self.inner.channel().is_closed()
3600 }
3601 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3602 self.inner.channel().on_closed()
3603 }
3604
3605 #[cfg(target_os = "fuchsia")]
3606 fn signal_peer(
3607 &self,
3608 clear_mask: zx::Signals,
3609 set_mask: zx::Signals,
3610 ) -> Result<(), zx_status::Status> {
3611 use fidl::Peered;
3612 self.inner.channel().signal_peer(clear_mask, set_mask)
3613 }
3614}
3615
3616impl ControllerControlHandle {
3617 pub fn send_on_notification(
3618 &self,
3619 mut timestamp: i64,
3620 mut notification: &Notification,
3621 ) -> Result<(), fidl::Error> {
3622 self.inner.send::<ControllerOnNotificationRequest>(
3623 (timestamp, notification),
3624 0,
3625 0x796259451db67281,
3626 fidl::encoding::DynamicFlags::empty(),
3627 )
3628 }
3629}
3630
3631#[must_use = "FIDL methods require a response to be sent"]
3632#[derive(Debug)]
3633pub struct ControllerGetPlayerApplicationSettingsResponder {
3634 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3635 tx_id: u32,
3636}
3637
3638impl std::ops::Drop for ControllerGetPlayerApplicationSettingsResponder {
3642 fn drop(&mut self) {
3643 self.control_handle.shutdown();
3644 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3646 }
3647}
3648
3649impl fidl::endpoints::Responder for ControllerGetPlayerApplicationSettingsResponder {
3650 type ControlHandle = ControllerControlHandle;
3651
3652 fn control_handle(&self) -> &ControllerControlHandle {
3653 &self.control_handle
3654 }
3655
3656 fn drop_without_shutdown(mut self) {
3657 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3659 std::mem::forget(self);
3661 }
3662}
3663
3664impl ControllerGetPlayerApplicationSettingsResponder {
3665 pub fn send(
3669 self,
3670 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3671 ) -> Result<(), fidl::Error> {
3672 let _result = self.send_raw(result);
3673 if _result.is_err() {
3674 self.control_handle.shutdown();
3675 }
3676 self.drop_without_shutdown();
3677 _result
3678 }
3679
3680 pub fn send_no_shutdown_on_err(
3682 self,
3683 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3684 ) -> Result<(), fidl::Error> {
3685 let _result = self.send_raw(result);
3686 self.drop_without_shutdown();
3687 _result
3688 }
3689
3690 fn send_raw(
3691 &self,
3692 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3693 ) -> Result<(), fidl::Error> {
3694 self.control_handle.inner.send::<fidl::encoding::ResultType<
3695 ControllerGetPlayerApplicationSettingsResponse,
3696 ControllerError,
3697 >>(
3698 result.map(|current_settings| (current_settings,)),
3699 self.tx_id,
3700 0x681de2da50670120,
3701 fidl::encoding::DynamicFlags::empty(),
3702 )
3703 }
3704}
3705
3706#[must_use = "FIDL methods require a response to be sent"]
3707#[derive(Debug)]
3708pub struct ControllerSetPlayerApplicationSettingsResponder {
3709 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3710 tx_id: u32,
3711}
3712
3713impl std::ops::Drop for ControllerSetPlayerApplicationSettingsResponder {
3717 fn drop(&mut self) {
3718 self.control_handle.shutdown();
3719 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3721 }
3722}
3723
3724impl fidl::endpoints::Responder for ControllerSetPlayerApplicationSettingsResponder {
3725 type ControlHandle = ControllerControlHandle;
3726
3727 fn control_handle(&self) -> &ControllerControlHandle {
3728 &self.control_handle
3729 }
3730
3731 fn drop_without_shutdown(mut self) {
3732 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3734 std::mem::forget(self);
3736 }
3737}
3738
3739impl ControllerSetPlayerApplicationSettingsResponder {
3740 pub fn send(
3744 self,
3745 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3746 ) -> Result<(), fidl::Error> {
3747 let _result = self.send_raw(result);
3748 if _result.is_err() {
3749 self.control_handle.shutdown();
3750 }
3751 self.drop_without_shutdown();
3752 _result
3753 }
3754
3755 pub fn send_no_shutdown_on_err(
3757 self,
3758 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3759 ) -> Result<(), fidl::Error> {
3760 let _result = self.send_raw(result);
3761 self.drop_without_shutdown();
3762 _result
3763 }
3764
3765 fn send_raw(
3766 &self,
3767 mut result: Result<&PlayerApplicationSettings, ControllerError>,
3768 ) -> Result<(), fidl::Error> {
3769 self.control_handle.inner.send::<fidl::encoding::ResultType<
3770 ControllerSetPlayerApplicationSettingsResponse,
3771 ControllerError,
3772 >>(
3773 result.map(|set_settings| (set_settings,)),
3774 self.tx_id,
3775 0x6a7c9689ea3a589a,
3776 fidl::encoding::DynamicFlags::empty(),
3777 )
3778 }
3779}
3780
3781#[must_use = "FIDL methods require a response to be sent"]
3782#[derive(Debug)]
3783pub struct ControllerGetMediaAttributesResponder {
3784 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3785 tx_id: u32,
3786}
3787
3788impl std::ops::Drop for ControllerGetMediaAttributesResponder {
3792 fn drop(&mut self) {
3793 self.control_handle.shutdown();
3794 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3796 }
3797}
3798
3799impl fidl::endpoints::Responder for ControllerGetMediaAttributesResponder {
3800 type ControlHandle = ControllerControlHandle;
3801
3802 fn control_handle(&self) -> &ControllerControlHandle {
3803 &self.control_handle
3804 }
3805
3806 fn drop_without_shutdown(mut self) {
3807 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3809 std::mem::forget(self);
3811 }
3812}
3813
3814impl ControllerGetMediaAttributesResponder {
3815 pub fn send(
3819 self,
3820 mut result: Result<&MediaAttributes, ControllerError>,
3821 ) -> Result<(), fidl::Error> {
3822 let _result = self.send_raw(result);
3823 if _result.is_err() {
3824 self.control_handle.shutdown();
3825 }
3826 self.drop_without_shutdown();
3827 _result
3828 }
3829
3830 pub fn send_no_shutdown_on_err(
3832 self,
3833 mut result: Result<&MediaAttributes, ControllerError>,
3834 ) -> Result<(), fidl::Error> {
3835 let _result = self.send_raw(result);
3836 self.drop_without_shutdown();
3837 _result
3838 }
3839
3840 fn send_raw(
3841 &self,
3842 mut result: Result<&MediaAttributes, ControllerError>,
3843 ) -> Result<(), fidl::Error> {
3844 self.control_handle.inner.send::<fidl::encoding::ResultType<
3845 ControllerGetMediaAttributesResponse,
3846 ControllerError,
3847 >>(
3848 result.map(|attributes| (attributes,)),
3849 self.tx_id,
3850 0x18bd14308ee3173d,
3851 fidl::encoding::DynamicFlags::empty(),
3852 )
3853 }
3854}
3855
3856#[must_use = "FIDL methods require a response to be sent"]
3857#[derive(Debug)]
3858pub struct ControllerGetPlayStatusResponder {
3859 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3860 tx_id: u32,
3861}
3862
3863impl std::ops::Drop for ControllerGetPlayStatusResponder {
3867 fn drop(&mut self) {
3868 self.control_handle.shutdown();
3869 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3871 }
3872}
3873
3874impl fidl::endpoints::Responder for ControllerGetPlayStatusResponder {
3875 type ControlHandle = ControllerControlHandle;
3876
3877 fn control_handle(&self) -> &ControllerControlHandle {
3878 &self.control_handle
3879 }
3880
3881 fn drop_without_shutdown(mut self) {
3882 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3884 std::mem::forget(self);
3886 }
3887}
3888
3889impl ControllerGetPlayStatusResponder {
3890 pub fn send(self, mut result: Result<&PlayStatus, ControllerError>) -> Result<(), fidl::Error> {
3894 let _result = self.send_raw(result);
3895 if _result.is_err() {
3896 self.control_handle.shutdown();
3897 }
3898 self.drop_without_shutdown();
3899 _result
3900 }
3901
3902 pub fn send_no_shutdown_on_err(
3904 self,
3905 mut result: Result<&PlayStatus, ControllerError>,
3906 ) -> Result<(), fidl::Error> {
3907 let _result = self.send_raw(result);
3908 self.drop_without_shutdown();
3909 _result
3910 }
3911
3912 fn send_raw(
3913 &self,
3914 mut result: Result<&PlayStatus, ControllerError>,
3915 ) -> Result<(), fidl::Error> {
3916 self.control_handle.inner.send::<fidl::encoding::ResultType<
3917 ControllerGetPlayStatusResponse,
3918 ControllerError,
3919 >>(
3920 result.map(|play_status| (play_status,)),
3921 self.tx_id,
3922 0x120735bec709fc6d,
3923 fidl::encoding::DynamicFlags::empty(),
3924 )
3925 }
3926}
3927
3928#[must_use = "FIDL methods require a response to be sent"]
3929#[derive(Debug)]
3930pub struct ControllerSetAbsoluteVolumeResponder {
3931 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
3932 tx_id: u32,
3933}
3934
3935impl std::ops::Drop for ControllerSetAbsoluteVolumeResponder {
3939 fn drop(&mut self) {
3940 self.control_handle.shutdown();
3941 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3943 }
3944}
3945
3946impl fidl::endpoints::Responder for ControllerSetAbsoluteVolumeResponder {
3947 type ControlHandle = ControllerControlHandle;
3948
3949 fn control_handle(&self) -> &ControllerControlHandle {
3950 &self.control_handle
3951 }
3952
3953 fn drop_without_shutdown(mut self) {
3954 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3956 std::mem::forget(self);
3958 }
3959}
3960
3961impl ControllerSetAbsoluteVolumeResponder {
3962 pub fn send(self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
3966 let _result = self.send_raw(result);
3967 if _result.is_err() {
3968 self.control_handle.shutdown();
3969 }
3970 self.drop_without_shutdown();
3971 _result
3972 }
3973
3974 pub fn send_no_shutdown_on_err(
3976 self,
3977 mut result: Result<u8, ControllerError>,
3978 ) -> Result<(), fidl::Error> {
3979 let _result = self.send_raw(result);
3980 self.drop_without_shutdown();
3981 _result
3982 }
3983
3984 fn send_raw(&self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
3985 self.control_handle.inner.send::<fidl::encoding::ResultType<
3986 ControllerSetAbsoluteVolumeResponse,
3987 ControllerError,
3988 >>(
3989 result.map(|set_volume| (set_volume,)),
3990 self.tx_id,
3991 0x1b8d010e11d05957,
3992 fidl::encoding::DynamicFlags::empty(),
3993 )
3994 }
3995}
3996
3997#[must_use = "FIDL methods require a response to be sent"]
3998#[derive(Debug)]
3999pub struct ControllerInformBatteryStatusResponder {
4000 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
4001 tx_id: u32,
4002}
4003
4004impl std::ops::Drop for ControllerInformBatteryStatusResponder {
4008 fn drop(&mut self) {
4009 self.control_handle.shutdown();
4010 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4012 }
4013}
4014
4015impl fidl::endpoints::Responder for ControllerInformBatteryStatusResponder {
4016 type ControlHandle = ControllerControlHandle;
4017
4018 fn control_handle(&self) -> &ControllerControlHandle {
4019 &self.control_handle
4020 }
4021
4022 fn drop_without_shutdown(mut self) {
4023 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4025 std::mem::forget(self);
4027 }
4028}
4029
4030impl ControllerInformBatteryStatusResponder {
4031 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4035 let _result = self.send_raw(result);
4036 if _result.is_err() {
4037 self.control_handle.shutdown();
4038 }
4039 self.drop_without_shutdown();
4040 _result
4041 }
4042
4043 pub fn send_no_shutdown_on_err(
4045 self,
4046 mut result: Result<(), ControllerError>,
4047 ) -> Result<(), fidl::Error> {
4048 let _result = self.send_raw(result);
4049 self.drop_without_shutdown();
4050 _result
4051 }
4052
4053 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4054 self.control_handle.inner.send::<fidl::encoding::ResultType<
4055 fidl::encoding::EmptyStruct,
4056 ControllerError,
4057 >>(
4058 result,
4059 self.tx_id,
4060 0x11d54fbe9d12c44d,
4061 fidl::encoding::DynamicFlags::empty(),
4062 )
4063 }
4064}
4065
4066#[must_use = "FIDL methods require a response to be sent"]
4067#[derive(Debug)]
4068pub struct ControllerSetAddressedPlayerResponder {
4069 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
4070 tx_id: u32,
4071}
4072
4073impl std::ops::Drop for ControllerSetAddressedPlayerResponder {
4077 fn drop(&mut self) {
4078 self.control_handle.shutdown();
4079 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4081 }
4082}
4083
4084impl fidl::endpoints::Responder for ControllerSetAddressedPlayerResponder {
4085 type ControlHandle = ControllerControlHandle;
4086
4087 fn control_handle(&self) -> &ControllerControlHandle {
4088 &self.control_handle
4089 }
4090
4091 fn drop_without_shutdown(mut self) {
4092 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4094 std::mem::forget(self);
4096 }
4097}
4098
4099impl ControllerSetAddressedPlayerResponder {
4100 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4104 let _result = self.send_raw(result);
4105 if _result.is_err() {
4106 self.control_handle.shutdown();
4107 }
4108 self.drop_without_shutdown();
4109 _result
4110 }
4111
4112 pub fn send_no_shutdown_on_err(
4114 self,
4115 mut result: Result<(), ControllerError>,
4116 ) -> Result<(), fidl::Error> {
4117 let _result = self.send_raw(result);
4118 self.drop_without_shutdown();
4119 _result
4120 }
4121
4122 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4123 self.control_handle.inner.send::<fidl::encoding::ResultType<
4124 fidl::encoding::EmptyStruct,
4125 ControllerError,
4126 >>(
4127 result,
4128 self.tx_id,
4129 0x7ffc261f10ee1da5,
4130 fidl::encoding::DynamicFlags::empty(),
4131 )
4132 }
4133}
4134
4135#[must_use = "FIDL methods require a response to be sent"]
4136#[derive(Debug)]
4137pub struct ControllerSendCommandResponder {
4138 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
4139 tx_id: u32,
4140}
4141
4142impl std::ops::Drop for ControllerSendCommandResponder {
4146 fn drop(&mut self) {
4147 self.control_handle.shutdown();
4148 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4150 }
4151}
4152
4153impl fidl::endpoints::Responder for ControllerSendCommandResponder {
4154 type ControlHandle = ControllerControlHandle;
4155
4156 fn control_handle(&self) -> &ControllerControlHandle {
4157 &self.control_handle
4158 }
4159
4160 fn drop_without_shutdown(mut self) {
4161 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4163 std::mem::forget(self);
4165 }
4166}
4167
4168impl ControllerSendCommandResponder {
4169 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4173 let _result = self.send_raw(result);
4174 if _result.is_err() {
4175 self.control_handle.shutdown();
4176 }
4177 self.drop_without_shutdown();
4178 _result
4179 }
4180
4181 pub fn send_no_shutdown_on_err(
4183 self,
4184 mut result: Result<(), ControllerError>,
4185 ) -> Result<(), fidl::Error> {
4186 let _result = self.send_raw(result);
4187 self.drop_without_shutdown();
4188 _result
4189 }
4190
4191 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
4192 self.control_handle.inner.send::<fidl::encoding::ResultType<
4193 fidl::encoding::EmptyStruct,
4194 ControllerError,
4195 >>(
4196 result,
4197 self.tx_id,
4198 0x241324c56b5bc257,
4199 fidl::encoding::DynamicFlags::empty(),
4200 )
4201 }
4202}
4203
4204#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4205pub struct PeerManagerMarker;
4206
4207impl fidl::endpoints::ProtocolMarker for PeerManagerMarker {
4208 type Proxy = PeerManagerProxy;
4209 type RequestStream = PeerManagerRequestStream;
4210 #[cfg(target_os = "fuchsia")]
4211 type SynchronousProxy = PeerManagerSynchronousProxy;
4212
4213 const DEBUG_NAME: &'static str = "fuchsia.bluetooth.avrcp.PeerManager";
4214}
4215impl fidl::endpoints::DiscoverableProtocolMarker for PeerManagerMarker {}
4216pub type PeerManagerGetBrowseControllerForTargetResult = Result<(), i32>;
4217pub type PeerManagerGetControllerForTargetResult = Result<(), i32>;
4218pub type PeerManagerSetAbsoluteVolumeHandlerResult = Result<(), i32>;
4219pub type PeerManagerRegisterTargetHandlerResult = Result<(), i32>;
4220
4221pub trait PeerManagerProxyInterface: Send + Sync {
4222 type GetBrowseControllerForTargetResponseFut: std::future::Future<
4223 Output = Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error>,
4224 > + Send;
4225 fn r#get_browse_controller_for_target(
4226 &self,
4227 peer_id: &fidl_fuchsia_bluetooth::PeerId,
4228 client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4229 ) -> Self::GetBrowseControllerForTargetResponseFut;
4230 type GetControllerForTargetResponseFut: std::future::Future<Output = Result<PeerManagerGetControllerForTargetResult, fidl::Error>>
4231 + Send;
4232 fn r#get_controller_for_target(
4233 &self,
4234 peer_id: &fidl_fuchsia_bluetooth::PeerId,
4235 client: fidl::endpoints::ServerEnd<ControllerMarker>,
4236 ) -> Self::GetControllerForTargetResponseFut;
4237 type SetAbsoluteVolumeHandlerResponseFut: std::future::Future<Output = Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error>>
4238 + Send;
4239 fn r#set_absolute_volume_handler(
4240 &self,
4241 handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4242 ) -> Self::SetAbsoluteVolumeHandlerResponseFut;
4243 type RegisterTargetHandlerResponseFut: std::future::Future<Output = Result<PeerManagerRegisterTargetHandlerResult, fidl::Error>>
4244 + Send;
4245 fn r#register_target_handler(
4246 &self,
4247 handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4248 ) -> Self::RegisterTargetHandlerResponseFut;
4249}
4250#[derive(Debug)]
4251#[cfg(target_os = "fuchsia")]
4252pub struct PeerManagerSynchronousProxy {
4253 client: fidl::client::sync::Client,
4254}
4255
4256#[cfg(target_os = "fuchsia")]
4257impl fidl::endpoints::SynchronousProxy for PeerManagerSynchronousProxy {
4258 type Proxy = PeerManagerProxy;
4259 type Protocol = PeerManagerMarker;
4260
4261 fn from_channel(inner: fidl::Channel) -> Self {
4262 Self::new(inner)
4263 }
4264
4265 fn into_channel(self) -> fidl::Channel {
4266 self.client.into_channel()
4267 }
4268
4269 fn as_channel(&self) -> &fidl::Channel {
4270 self.client.as_channel()
4271 }
4272}
4273
4274#[cfg(target_os = "fuchsia")]
4275impl PeerManagerSynchronousProxy {
4276 pub fn new(channel: fidl::Channel) -> Self {
4277 let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4278 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4279 }
4280
4281 pub fn into_channel(self) -> fidl::Channel {
4282 self.client.into_channel()
4283 }
4284
4285 pub fn wait_for_event(
4288 &self,
4289 deadline: zx::MonotonicInstant,
4290 ) -> Result<PeerManagerEvent, fidl::Error> {
4291 PeerManagerEvent::decode(self.client.wait_for_event(deadline)?)
4292 }
4293
4294 pub fn r#get_browse_controller_for_target(
4297 &self,
4298 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4299 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4300 ___deadline: zx::MonotonicInstant,
4301 ) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
4302 let _response = self.client.send_query::<
4303 PeerManagerGetBrowseControllerForTargetRequest,
4304 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4305 >(
4306 (peer_id, client,),
4307 0x5b75bbb8d58a6d49,
4308 fidl::encoding::DynamicFlags::empty(),
4309 ___deadline,
4310 )?;
4311 Ok(_response.map(|x| x))
4312 }
4313
4314 pub fn r#get_controller_for_target(
4317 &self,
4318 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4319 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
4320 ___deadline: zx::MonotonicInstant,
4321 ) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
4322 let _response = self.client.send_query::<
4323 PeerManagerGetControllerForTargetRequest,
4324 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4325 >(
4326 (peer_id, client,),
4327 0x25d36e51516bc3b4,
4328 fidl::encoding::DynamicFlags::empty(),
4329 ___deadline,
4330 )?;
4331 Ok(_response.map(|x| x))
4332 }
4333
4334 pub fn r#set_absolute_volume_handler(
4338 &self,
4339 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4340 ___deadline: zx::MonotonicInstant,
4341 ) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
4342 let _response = self.client.send_query::<
4343 PeerManagerSetAbsoluteVolumeHandlerRequest,
4344 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4345 >(
4346 (handler,),
4347 0x39a465c63e9f918c,
4348 fidl::encoding::DynamicFlags::empty(),
4349 ___deadline,
4350 )?;
4351 Ok(_response.map(|x| x))
4352 }
4353
4354 pub fn r#register_target_handler(
4357 &self,
4358 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4359 ___deadline: zx::MonotonicInstant,
4360 ) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
4361 let _response = self.client.send_query::<
4362 PeerManagerRegisterTargetHandlerRequest,
4363 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4364 >(
4365 (handler,),
4366 0x4bc919acb791bdb3,
4367 fidl::encoding::DynamicFlags::empty(),
4368 ___deadline,
4369 )?;
4370 Ok(_response.map(|x| x))
4371 }
4372}
4373
4374#[cfg(target_os = "fuchsia")]
4375impl From<PeerManagerSynchronousProxy> for zx::Handle {
4376 fn from(value: PeerManagerSynchronousProxy) -> Self {
4377 value.into_channel().into()
4378 }
4379}
4380
4381#[cfg(target_os = "fuchsia")]
4382impl From<fidl::Channel> for PeerManagerSynchronousProxy {
4383 fn from(value: fidl::Channel) -> Self {
4384 Self::new(value)
4385 }
4386}
4387
4388#[derive(Debug, Clone)]
4389pub struct PeerManagerProxy {
4390 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4391}
4392
4393impl fidl::endpoints::Proxy for PeerManagerProxy {
4394 type Protocol = PeerManagerMarker;
4395
4396 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4397 Self::new(inner)
4398 }
4399
4400 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4401 self.client.into_channel().map_err(|client| Self { client })
4402 }
4403
4404 fn as_channel(&self) -> &::fidl::AsyncChannel {
4405 self.client.as_channel()
4406 }
4407}
4408
4409impl PeerManagerProxy {
4410 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4412 let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4413 Self { client: fidl::client::Client::new(channel, protocol_name) }
4414 }
4415
4416 pub fn take_event_stream(&self) -> PeerManagerEventStream {
4422 PeerManagerEventStream { event_receiver: self.client.take_event_receiver() }
4423 }
4424
4425 pub fn r#get_browse_controller_for_target(
4428 &self,
4429 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4430 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4431 ) -> fidl::client::QueryResponseFut<
4432 PeerManagerGetBrowseControllerForTargetResult,
4433 fidl::encoding::DefaultFuchsiaResourceDialect,
4434 > {
4435 PeerManagerProxyInterface::r#get_browse_controller_for_target(self, peer_id, client)
4436 }
4437
4438 pub fn r#get_controller_for_target(
4441 &self,
4442 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4443 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
4444 ) -> fidl::client::QueryResponseFut<
4445 PeerManagerGetControllerForTargetResult,
4446 fidl::encoding::DefaultFuchsiaResourceDialect,
4447 > {
4448 PeerManagerProxyInterface::r#get_controller_for_target(self, peer_id, client)
4449 }
4450
4451 pub fn r#set_absolute_volume_handler(
4455 &self,
4456 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4457 ) -> fidl::client::QueryResponseFut<
4458 PeerManagerSetAbsoluteVolumeHandlerResult,
4459 fidl::encoding::DefaultFuchsiaResourceDialect,
4460 > {
4461 PeerManagerProxyInterface::r#set_absolute_volume_handler(self, handler)
4462 }
4463
4464 pub fn r#register_target_handler(
4467 &self,
4468 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4469 ) -> fidl::client::QueryResponseFut<
4470 PeerManagerRegisterTargetHandlerResult,
4471 fidl::encoding::DefaultFuchsiaResourceDialect,
4472 > {
4473 PeerManagerProxyInterface::r#register_target_handler(self, handler)
4474 }
4475}
4476
4477impl PeerManagerProxyInterface for PeerManagerProxy {
4478 type GetBrowseControllerForTargetResponseFut = fidl::client::QueryResponseFut<
4479 PeerManagerGetBrowseControllerForTargetResult,
4480 fidl::encoding::DefaultFuchsiaResourceDialect,
4481 >;
4482 fn r#get_browse_controller_for_target(
4483 &self,
4484 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4485 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4486 ) -> Self::GetBrowseControllerForTargetResponseFut {
4487 fn _decode(
4488 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4489 ) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
4490 let _response = fidl::client::decode_transaction_body::<
4491 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4492 fidl::encoding::DefaultFuchsiaResourceDialect,
4493 0x5b75bbb8d58a6d49,
4494 >(_buf?)?;
4495 Ok(_response.map(|x| x))
4496 }
4497 self.client.send_query_and_decode::<
4498 PeerManagerGetBrowseControllerForTargetRequest,
4499 PeerManagerGetBrowseControllerForTargetResult,
4500 >(
4501 (peer_id, client,),
4502 0x5b75bbb8d58a6d49,
4503 fidl::encoding::DynamicFlags::empty(),
4504 _decode,
4505 )
4506 }
4507
4508 type GetControllerForTargetResponseFut = fidl::client::QueryResponseFut<
4509 PeerManagerGetControllerForTargetResult,
4510 fidl::encoding::DefaultFuchsiaResourceDialect,
4511 >;
4512 fn r#get_controller_for_target(
4513 &self,
4514 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
4515 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
4516 ) -> Self::GetControllerForTargetResponseFut {
4517 fn _decode(
4518 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4519 ) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
4520 let _response = fidl::client::decode_transaction_body::<
4521 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4522 fidl::encoding::DefaultFuchsiaResourceDialect,
4523 0x25d36e51516bc3b4,
4524 >(_buf?)?;
4525 Ok(_response.map(|x| x))
4526 }
4527 self.client.send_query_and_decode::<
4528 PeerManagerGetControllerForTargetRequest,
4529 PeerManagerGetControllerForTargetResult,
4530 >(
4531 (peer_id, client,),
4532 0x25d36e51516bc3b4,
4533 fidl::encoding::DynamicFlags::empty(),
4534 _decode,
4535 )
4536 }
4537
4538 type SetAbsoluteVolumeHandlerResponseFut = fidl::client::QueryResponseFut<
4539 PeerManagerSetAbsoluteVolumeHandlerResult,
4540 fidl::encoding::DefaultFuchsiaResourceDialect,
4541 >;
4542 fn r#set_absolute_volume_handler(
4543 &self,
4544 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4545 ) -> Self::SetAbsoluteVolumeHandlerResponseFut {
4546 fn _decode(
4547 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4548 ) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
4549 let _response = fidl::client::decode_transaction_body::<
4550 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4551 fidl::encoding::DefaultFuchsiaResourceDialect,
4552 0x39a465c63e9f918c,
4553 >(_buf?)?;
4554 Ok(_response.map(|x| x))
4555 }
4556 self.client.send_query_and_decode::<
4557 PeerManagerSetAbsoluteVolumeHandlerRequest,
4558 PeerManagerSetAbsoluteVolumeHandlerResult,
4559 >(
4560 (handler,),
4561 0x39a465c63e9f918c,
4562 fidl::encoding::DynamicFlags::empty(),
4563 _decode,
4564 )
4565 }
4566
4567 type RegisterTargetHandlerResponseFut = fidl::client::QueryResponseFut<
4568 PeerManagerRegisterTargetHandlerResult,
4569 fidl::encoding::DefaultFuchsiaResourceDialect,
4570 >;
4571 fn r#register_target_handler(
4572 &self,
4573 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4574 ) -> Self::RegisterTargetHandlerResponseFut {
4575 fn _decode(
4576 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4577 ) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
4578 let _response = fidl::client::decode_transaction_body::<
4579 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4580 fidl::encoding::DefaultFuchsiaResourceDialect,
4581 0x4bc919acb791bdb3,
4582 >(_buf?)?;
4583 Ok(_response.map(|x| x))
4584 }
4585 self.client.send_query_and_decode::<
4586 PeerManagerRegisterTargetHandlerRequest,
4587 PeerManagerRegisterTargetHandlerResult,
4588 >(
4589 (handler,),
4590 0x4bc919acb791bdb3,
4591 fidl::encoding::DynamicFlags::empty(),
4592 _decode,
4593 )
4594 }
4595}
4596
4597pub struct PeerManagerEventStream {
4598 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4599}
4600
4601impl std::marker::Unpin for PeerManagerEventStream {}
4602
4603impl futures::stream::FusedStream for PeerManagerEventStream {
4604 fn is_terminated(&self) -> bool {
4605 self.event_receiver.is_terminated()
4606 }
4607}
4608
4609impl futures::Stream for PeerManagerEventStream {
4610 type Item = Result<PeerManagerEvent, fidl::Error>;
4611
4612 fn poll_next(
4613 mut self: std::pin::Pin<&mut Self>,
4614 cx: &mut std::task::Context<'_>,
4615 ) -> std::task::Poll<Option<Self::Item>> {
4616 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4617 &mut self.event_receiver,
4618 cx
4619 )?) {
4620 Some(buf) => std::task::Poll::Ready(Some(PeerManagerEvent::decode(buf))),
4621 None => std::task::Poll::Ready(None),
4622 }
4623 }
4624}
4625
4626#[derive(Debug)]
4627pub enum PeerManagerEvent {}
4628
4629impl PeerManagerEvent {
4630 fn decode(
4632 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4633 ) -> Result<PeerManagerEvent, fidl::Error> {
4634 let (bytes, _handles) = buf.split_mut();
4635 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4636 debug_assert_eq!(tx_header.tx_id, 0);
4637 match tx_header.ordinal {
4638 _ => Err(fidl::Error::UnknownOrdinal {
4639 ordinal: tx_header.ordinal,
4640 protocol_name: <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4641 }),
4642 }
4643 }
4644}
4645
4646pub struct PeerManagerRequestStream {
4648 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4649 is_terminated: bool,
4650}
4651
4652impl std::marker::Unpin for PeerManagerRequestStream {}
4653
4654impl futures::stream::FusedStream for PeerManagerRequestStream {
4655 fn is_terminated(&self) -> bool {
4656 self.is_terminated
4657 }
4658}
4659
4660impl fidl::endpoints::RequestStream for PeerManagerRequestStream {
4661 type Protocol = PeerManagerMarker;
4662 type ControlHandle = PeerManagerControlHandle;
4663
4664 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4665 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4666 }
4667
4668 fn control_handle(&self) -> Self::ControlHandle {
4669 PeerManagerControlHandle { inner: self.inner.clone() }
4670 }
4671
4672 fn into_inner(
4673 self,
4674 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4675 {
4676 (self.inner, self.is_terminated)
4677 }
4678
4679 fn from_inner(
4680 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4681 is_terminated: bool,
4682 ) -> Self {
4683 Self { inner, is_terminated }
4684 }
4685}
4686
4687impl futures::Stream for PeerManagerRequestStream {
4688 type Item = Result<PeerManagerRequest, fidl::Error>;
4689
4690 fn poll_next(
4691 mut self: std::pin::Pin<&mut Self>,
4692 cx: &mut std::task::Context<'_>,
4693 ) -> std::task::Poll<Option<Self::Item>> {
4694 let this = &mut *self;
4695 if this.inner.check_shutdown(cx) {
4696 this.is_terminated = true;
4697 return std::task::Poll::Ready(None);
4698 }
4699 if this.is_terminated {
4700 panic!("polled PeerManagerRequestStream after completion");
4701 }
4702 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4703 |bytes, handles| {
4704 match this.inner.channel().read_etc(cx, bytes, handles) {
4705 std::task::Poll::Ready(Ok(())) => {}
4706 std::task::Poll::Pending => return std::task::Poll::Pending,
4707 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4708 this.is_terminated = true;
4709 return std::task::Poll::Ready(None);
4710 }
4711 std::task::Poll::Ready(Err(e)) => {
4712 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4713 e.into(),
4714 ))))
4715 }
4716 }
4717
4718 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4720
4721 std::task::Poll::Ready(Some(match header.ordinal {
4722 0x5b75bbb8d58a6d49 => {
4723 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4724 let mut req = fidl::new_empty!(
4725 PeerManagerGetBrowseControllerForTargetRequest,
4726 fidl::encoding::DefaultFuchsiaResourceDialect
4727 );
4728 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetBrowseControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
4729 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
4730 Ok(PeerManagerRequest::GetBrowseControllerForTarget {
4731 peer_id: req.peer_id,
4732 client: req.client,
4733
4734 responder: PeerManagerGetBrowseControllerForTargetResponder {
4735 control_handle: std::mem::ManuallyDrop::new(control_handle),
4736 tx_id: header.tx_id,
4737 },
4738 })
4739 }
4740 0x25d36e51516bc3b4 => {
4741 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4742 let mut req = fidl::new_empty!(
4743 PeerManagerGetControllerForTargetRequest,
4744 fidl::encoding::DefaultFuchsiaResourceDialect
4745 );
4746 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
4747 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
4748 Ok(PeerManagerRequest::GetControllerForTarget {
4749 peer_id: req.peer_id,
4750 client: req.client,
4751
4752 responder: PeerManagerGetControllerForTargetResponder {
4753 control_handle: std::mem::ManuallyDrop::new(control_handle),
4754 tx_id: header.tx_id,
4755 },
4756 })
4757 }
4758 0x39a465c63e9f918c => {
4759 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4760 let mut req = fidl::new_empty!(
4761 PeerManagerSetAbsoluteVolumeHandlerRequest,
4762 fidl::encoding::DefaultFuchsiaResourceDialect
4763 );
4764 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerSetAbsoluteVolumeHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
4765 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
4766 Ok(PeerManagerRequest::SetAbsoluteVolumeHandler {
4767 handler: req.handler,
4768
4769 responder: PeerManagerSetAbsoluteVolumeHandlerResponder {
4770 control_handle: std::mem::ManuallyDrop::new(control_handle),
4771 tx_id: header.tx_id,
4772 },
4773 })
4774 }
4775 0x4bc919acb791bdb3 => {
4776 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4777 let mut req = fidl::new_empty!(
4778 PeerManagerRegisterTargetHandlerRequest,
4779 fidl::encoding::DefaultFuchsiaResourceDialect
4780 );
4781 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerRegisterTargetHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
4782 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
4783 Ok(PeerManagerRequest::RegisterTargetHandler {
4784 handler: req.handler,
4785
4786 responder: PeerManagerRegisterTargetHandlerResponder {
4787 control_handle: std::mem::ManuallyDrop::new(control_handle),
4788 tx_id: header.tx_id,
4789 },
4790 })
4791 }
4792 _ => Err(fidl::Error::UnknownOrdinal {
4793 ordinal: header.ordinal,
4794 protocol_name:
4795 <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4796 }),
4797 }))
4798 },
4799 )
4800 }
4801}
4802
4803#[derive(Debug)]
4804pub enum PeerManagerRequest {
4805 GetBrowseControllerForTarget {
4808 peer_id: fidl_fuchsia_bluetooth::PeerId,
4809 client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4810 responder: PeerManagerGetBrowseControllerForTargetResponder,
4811 },
4812 GetControllerForTarget {
4815 peer_id: fidl_fuchsia_bluetooth::PeerId,
4816 client: fidl::endpoints::ServerEnd<ControllerMarker>,
4817 responder: PeerManagerGetControllerForTargetResponder,
4818 },
4819 SetAbsoluteVolumeHandler {
4823 handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4824 responder: PeerManagerSetAbsoluteVolumeHandlerResponder,
4825 },
4826 RegisterTargetHandler {
4829 handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4830 responder: PeerManagerRegisterTargetHandlerResponder,
4831 },
4832}
4833
4834impl PeerManagerRequest {
4835 #[allow(irrefutable_let_patterns)]
4836 pub fn into_get_browse_controller_for_target(
4837 self,
4838 ) -> Option<(
4839 fidl_fuchsia_bluetooth::PeerId,
4840 fidl::endpoints::ServerEnd<BrowseControllerMarker>,
4841 PeerManagerGetBrowseControllerForTargetResponder,
4842 )> {
4843 if let PeerManagerRequest::GetBrowseControllerForTarget { peer_id, client, responder } =
4844 self
4845 {
4846 Some((peer_id, client, responder))
4847 } else {
4848 None
4849 }
4850 }
4851
4852 #[allow(irrefutable_let_patterns)]
4853 pub fn into_get_controller_for_target(
4854 self,
4855 ) -> Option<(
4856 fidl_fuchsia_bluetooth::PeerId,
4857 fidl::endpoints::ServerEnd<ControllerMarker>,
4858 PeerManagerGetControllerForTargetResponder,
4859 )> {
4860 if let PeerManagerRequest::GetControllerForTarget { peer_id, client, responder } = self {
4861 Some((peer_id, client, responder))
4862 } else {
4863 None
4864 }
4865 }
4866
4867 #[allow(irrefutable_let_patterns)]
4868 pub fn into_set_absolute_volume_handler(
4869 self,
4870 ) -> Option<(
4871 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
4872 PeerManagerSetAbsoluteVolumeHandlerResponder,
4873 )> {
4874 if let PeerManagerRequest::SetAbsoluteVolumeHandler { handler, responder } = self {
4875 Some((handler, responder))
4876 } else {
4877 None
4878 }
4879 }
4880
4881 #[allow(irrefutable_let_patterns)]
4882 pub fn into_register_target_handler(
4883 self,
4884 ) -> Option<(
4885 fidl::endpoints::ClientEnd<TargetHandlerMarker>,
4886 PeerManagerRegisterTargetHandlerResponder,
4887 )> {
4888 if let PeerManagerRequest::RegisterTargetHandler { handler, responder } = self {
4889 Some((handler, responder))
4890 } else {
4891 None
4892 }
4893 }
4894
4895 pub fn method_name(&self) -> &'static str {
4897 match *self {
4898 PeerManagerRequest::GetBrowseControllerForTarget { .. } => {
4899 "get_browse_controller_for_target"
4900 }
4901 PeerManagerRequest::GetControllerForTarget { .. } => "get_controller_for_target",
4902 PeerManagerRequest::SetAbsoluteVolumeHandler { .. } => "set_absolute_volume_handler",
4903 PeerManagerRequest::RegisterTargetHandler { .. } => "register_target_handler",
4904 }
4905 }
4906}
4907
4908#[derive(Debug, Clone)]
4909pub struct PeerManagerControlHandle {
4910 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4911}
4912
4913impl fidl::endpoints::ControlHandle for PeerManagerControlHandle {
4914 fn shutdown(&self) {
4915 self.inner.shutdown()
4916 }
4917 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4918 self.inner.shutdown_with_epitaph(status)
4919 }
4920
4921 fn is_closed(&self) -> bool {
4922 self.inner.channel().is_closed()
4923 }
4924 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4925 self.inner.channel().on_closed()
4926 }
4927
4928 #[cfg(target_os = "fuchsia")]
4929 fn signal_peer(
4930 &self,
4931 clear_mask: zx::Signals,
4932 set_mask: zx::Signals,
4933 ) -> Result<(), zx_status::Status> {
4934 use fidl::Peered;
4935 self.inner.channel().signal_peer(clear_mask, set_mask)
4936 }
4937}
4938
4939impl PeerManagerControlHandle {}
4940
4941#[must_use = "FIDL methods require a response to be sent"]
4942#[derive(Debug)]
4943pub struct PeerManagerGetBrowseControllerForTargetResponder {
4944 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
4945 tx_id: u32,
4946}
4947
4948impl std::ops::Drop for PeerManagerGetBrowseControllerForTargetResponder {
4952 fn drop(&mut self) {
4953 self.control_handle.shutdown();
4954 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4956 }
4957}
4958
4959impl fidl::endpoints::Responder for PeerManagerGetBrowseControllerForTargetResponder {
4960 type ControlHandle = PeerManagerControlHandle;
4961
4962 fn control_handle(&self) -> &PeerManagerControlHandle {
4963 &self.control_handle
4964 }
4965
4966 fn drop_without_shutdown(mut self) {
4967 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4969 std::mem::forget(self);
4971 }
4972}
4973
4974impl PeerManagerGetBrowseControllerForTargetResponder {
4975 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4979 let _result = self.send_raw(result);
4980 if _result.is_err() {
4981 self.control_handle.shutdown();
4982 }
4983 self.drop_without_shutdown();
4984 _result
4985 }
4986
4987 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4989 let _result = self.send_raw(result);
4990 self.drop_without_shutdown();
4991 _result
4992 }
4993
4994 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4995 self.control_handle
4996 .inner
4997 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4998 result,
4999 self.tx_id,
5000 0x5b75bbb8d58a6d49,
5001 fidl::encoding::DynamicFlags::empty(),
5002 )
5003 }
5004}
5005
5006#[must_use = "FIDL methods require a response to be sent"]
5007#[derive(Debug)]
5008pub struct PeerManagerGetControllerForTargetResponder {
5009 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
5010 tx_id: u32,
5011}
5012
5013impl std::ops::Drop for PeerManagerGetControllerForTargetResponder {
5017 fn drop(&mut self) {
5018 self.control_handle.shutdown();
5019 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5021 }
5022}
5023
5024impl fidl::endpoints::Responder for PeerManagerGetControllerForTargetResponder {
5025 type ControlHandle = PeerManagerControlHandle;
5026
5027 fn control_handle(&self) -> &PeerManagerControlHandle {
5028 &self.control_handle
5029 }
5030
5031 fn drop_without_shutdown(mut self) {
5032 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5034 std::mem::forget(self);
5036 }
5037}
5038
5039impl PeerManagerGetControllerForTargetResponder {
5040 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5044 let _result = self.send_raw(result);
5045 if _result.is_err() {
5046 self.control_handle.shutdown();
5047 }
5048 self.drop_without_shutdown();
5049 _result
5050 }
5051
5052 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5054 let _result = self.send_raw(result);
5055 self.drop_without_shutdown();
5056 _result
5057 }
5058
5059 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5060 self.control_handle
5061 .inner
5062 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5063 result,
5064 self.tx_id,
5065 0x25d36e51516bc3b4,
5066 fidl::encoding::DynamicFlags::empty(),
5067 )
5068 }
5069}
5070
5071#[must_use = "FIDL methods require a response to be sent"]
5072#[derive(Debug)]
5073pub struct PeerManagerSetAbsoluteVolumeHandlerResponder {
5074 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
5075 tx_id: u32,
5076}
5077
5078impl std::ops::Drop for PeerManagerSetAbsoluteVolumeHandlerResponder {
5082 fn drop(&mut self) {
5083 self.control_handle.shutdown();
5084 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5086 }
5087}
5088
5089impl fidl::endpoints::Responder for PeerManagerSetAbsoluteVolumeHandlerResponder {
5090 type ControlHandle = PeerManagerControlHandle;
5091
5092 fn control_handle(&self) -> &PeerManagerControlHandle {
5093 &self.control_handle
5094 }
5095
5096 fn drop_without_shutdown(mut self) {
5097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5099 std::mem::forget(self);
5101 }
5102}
5103
5104impl PeerManagerSetAbsoluteVolumeHandlerResponder {
5105 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5109 let _result = self.send_raw(result);
5110 if _result.is_err() {
5111 self.control_handle.shutdown();
5112 }
5113 self.drop_without_shutdown();
5114 _result
5115 }
5116
5117 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5119 let _result = self.send_raw(result);
5120 self.drop_without_shutdown();
5121 _result
5122 }
5123
5124 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5125 self.control_handle
5126 .inner
5127 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5128 result,
5129 self.tx_id,
5130 0x39a465c63e9f918c,
5131 fidl::encoding::DynamicFlags::empty(),
5132 )
5133 }
5134}
5135
5136#[must_use = "FIDL methods require a response to be sent"]
5137#[derive(Debug)]
5138pub struct PeerManagerRegisterTargetHandlerResponder {
5139 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
5140 tx_id: u32,
5141}
5142
5143impl std::ops::Drop for PeerManagerRegisterTargetHandlerResponder {
5147 fn drop(&mut self) {
5148 self.control_handle.shutdown();
5149 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5151 }
5152}
5153
5154impl fidl::endpoints::Responder for PeerManagerRegisterTargetHandlerResponder {
5155 type ControlHandle = PeerManagerControlHandle;
5156
5157 fn control_handle(&self) -> &PeerManagerControlHandle {
5158 &self.control_handle
5159 }
5160
5161 fn drop_without_shutdown(mut self) {
5162 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5164 std::mem::forget(self);
5166 }
5167}
5168
5169impl PeerManagerRegisterTargetHandlerResponder {
5170 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5174 let _result = self.send_raw(result);
5175 if _result.is_err() {
5176 self.control_handle.shutdown();
5177 }
5178 self.drop_without_shutdown();
5179 _result
5180 }
5181
5182 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5184 let _result = self.send_raw(result);
5185 self.drop_without_shutdown();
5186 _result
5187 }
5188
5189 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5190 self.control_handle
5191 .inner
5192 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5193 result,
5194 self.tx_id,
5195 0x4bc919acb791bdb3,
5196 fidl::encoding::DynamicFlags::empty(),
5197 )
5198 }
5199}
5200
5201#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5202pub struct TargetHandlerMarker;
5203
5204impl fidl::endpoints::ProtocolMarker for TargetHandlerMarker {
5205 type Proxy = TargetHandlerProxy;
5206 type RequestStream = TargetHandlerRequestStream;
5207 #[cfg(target_os = "fuchsia")]
5208 type SynchronousProxy = TargetHandlerSynchronousProxy;
5209
5210 const DEBUG_NAME: &'static str = "(anonymous) TargetHandler";
5211}
5212pub type TargetHandlerGetEventsSupportedResult = Result<Vec<NotificationEvent>, TargetAvcError>;
5213pub type TargetHandlerGetMediaAttributesResult = Result<MediaAttributes, TargetAvcError>;
5214pub type TargetHandlerGetPlayStatusResult = Result<PlayStatus, TargetAvcError>;
5215pub type TargetHandlerSendCommandResult = Result<(), TargetPassthroughError>;
5216pub type TargetHandlerListPlayerApplicationSettingAttributesResult =
5217 Result<Vec<PlayerApplicationSettingAttributeId>, TargetAvcError>;
5218pub type TargetHandlerGetPlayerApplicationSettingsResult =
5219 Result<PlayerApplicationSettings, TargetAvcError>;
5220pub type TargetHandlerSetPlayerApplicationSettingsResult =
5221 Result<PlayerApplicationSettings, TargetAvcError>;
5222pub type TargetHandlerGetNotificationResult = Result<Notification, TargetAvcError>;
5223pub type TargetHandlerWatchNotificationResult = Result<Notification, TargetAvcError>;
5224pub type TargetHandlerSetAddressedPlayerResult = Result<(), TargetAvcError>;
5225pub type TargetHandlerGetMediaPlayerItemsResult = Result<Vec<MediaPlayerItem>, TargetAvcError>;
5226
5227pub trait TargetHandlerProxyInterface: Send + Sync {
5228 type GetEventsSupportedResponseFut: std::future::Future<Output = Result<TargetHandlerGetEventsSupportedResult, fidl::Error>>
5229 + Send;
5230 fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut;
5231 type GetMediaAttributesResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaAttributesResult, fidl::Error>>
5232 + Send;
5233 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
5234 type GetPlayStatusResponseFut: std::future::Future<Output = Result<TargetHandlerGetPlayStatusResult, fidl::Error>>
5235 + Send;
5236 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
5237 type SendCommandResponseFut: std::future::Future<Output = Result<TargetHandlerSendCommandResult, fidl::Error>>
5238 + Send;
5239 fn r#send_command(
5240 &self,
5241 command: AvcPanelCommand,
5242 pressed: bool,
5243 ) -> Self::SendCommandResponseFut;
5244 type ListPlayerApplicationSettingAttributesResponseFut: std::future::Future<
5245 Output = Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>,
5246 > + Send;
5247 fn r#list_player_application_setting_attributes(
5248 &self,
5249 ) -> Self::ListPlayerApplicationSettingAttributesResponseFut;
5250 type GetPlayerApplicationSettingsResponseFut: std::future::Future<
5251 Output = Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error>,
5252 > + Send;
5253 fn r#get_player_application_settings(
5254 &self,
5255 attribute_ids: &[PlayerApplicationSettingAttributeId],
5256 ) -> Self::GetPlayerApplicationSettingsResponseFut;
5257 type SetPlayerApplicationSettingsResponseFut: std::future::Future<
5258 Output = Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error>,
5259 > + Send;
5260 fn r#set_player_application_settings(
5261 &self,
5262 requested_settings: &PlayerApplicationSettings,
5263 ) -> Self::SetPlayerApplicationSettingsResponseFut;
5264 type GetNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerGetNotificationResult, fidl::Error>>
5265 + Send;
5266 fn r#get_notification(&self, event_id: NotificationEvent) -> Self::GetNotificationResponseFut;
5267 type WatchNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerWatchNotificationResult, fidl::Error>>
5268 + Send;
5269 fn r#watch_notification(
5270 &self,
5271 event_id: NotificationEvent,
5272 current: &Notification,
5273 pos_change_interval: u32,
5274 ) -> Self::WatchNotificationResponseFut;
5275 type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<TargetHandlerSetAddressedPlayerResult, fidl::Error>>
5276 + Send;
5277 fn r#set_addressed_player(
5278 &self,
5279 player_id: &AddressedPlayerId,
5280 ) -> Self::SetAddressedPlayerResponseFut;
5281 type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error>>
5282 + Send;
5283 fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut;
5284}
5285#[derive(Debug)]
5286#[cfg(target_os = "fuchsia")]
5287pub struct TargetHandlerSynchronousProxy {
5288 client: fidl::client::sync::Client,
5289}
5290
5291#[cfg(target_os = "fuchsia")]
5292impl fidl::endpoints::SynchronousProxy for TargetHandlerSynchronousProxy {
5293 type Proxy = TargetHandlerProxy;
5294 type Protocol = TargetHandlerMarker;
5295
5296 fn from_channel(inner: fidl::Channel) -> Self {
5297 Self::new(inner)
5298 }
5299
5300 fn into_channel(self) -> fidl::Channel {
5301 self.client.into_channel()
5302 }
5303
5304 fn as_channel(&self) -> &fidl::Channel {
5305 self.client.as_channel()
5306 }
5307}
5308
5309#[cfg(target_os = "fuchsia")]
5310impl TargetHandlerSynchronousProxy {
5311 pub fn new(channel: fidl::Channel) -> Self {
5312 let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5313 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5314 }
5315
5316 pub fn into_channel(self) -> fidl::Channel {
5317 self.client.into_channel()
5318 }
5319
5320 pub fn wait_for_event(
5323 &self,
5324 deadline: zx::MonotonicInstant,
5325 ) -> Result<TargetHandlerEvent, fidl::Error> {
5326 TargetHandlerEvent::decode(self.client.wait_for_event(deadline)?)
5327 }
5328
5329 pub fn r#get_events_supported(
5331 &self,
5332 ___deadline: zx::MonotonicInstant,
5333 ) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
5334 let _response =
5335 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5336 TargetHandlerGetEventsSupportedResponse,
5337 TargetAvcError,
5338 >>(
5339 (),
5340 0x54bb8d817d5e1257,
5341 fidl::encoding::DynamicFlags::empty(),
5342 ___deadline,
5343 )?;
5344 Ok(_response.map(|x| x.notification_ids))
5345 }
5346
5347 pub fn r#get_media_attributes(
5351 &self,
5352 ___deadline: zx::MonotonicInstant,
5353 ) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
5354 let _response =
5355 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5356 TargetHandlerGetMediaAttributesResponse,
5357 TargetAvcError,
5358 >>(
5359 (),
5360 0x629f354d2805daf5,
5361 fidl::encoding::DynamicFlags::empty(),
5362 ___deadline,
5363 )?;
5364 Ok(_response.map(|x| x.attributes))
5365 }
5366
5367 pub fn r#get_play_status(
5369 &self,
5370 ___deadline: zx::MonotonicInstant,
5371 ) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
5372 let _response =
5373 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5374 TargetHandlerGetPlayStatusResponse,
5375 TargetAvcError,
5376 >>(
5377 (),
5378 0x24a4816300e14d89,
5379 fidl::encoding::DynamicFlags::empty(),
5380 ___deadline,
5381 )?;
5382 Ok(_response.map(|x| x.play_status))
5383 }
5384
5385 pub fn r#send_command(
5389 &self,
5390 mut command: AvcPanelCommand,
5391 mut pressed: bool,
5392 ___deadline: zx::MonotonicInstant,
5393 ) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
5394 let _response =
5395 self.client.send_query::<TargetHandlerSendCommandRequest, fidl::encoding::ResultType<
5396 fidl::encoding::EmptyStruct,
5397 TargetPassthroughError,
5398 >>(
5399 (command, pressed),
5400 0x69e063a8f6ab7b87,
5401 fidl::encoding::DynamicFlags::empty(),
5402 ___deadline,
5403 )?;
5404 Ok(_response.map(|x| x))
5405 }
5406
5407 pub fn r#list_player_application_setting_attributes(
5410 &self,
5411 ___deadline: zx::MonotonicInstant,
5412 ) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error> {
5413 let _response =
5414 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5415 TargetHandlerListPlayerApplicationSettingAttributesResponse,
5416 TargetAvcError,
5417 >>(
5418 (), 0xdfa38da6a60b2, fidl::encoding::DynamicFlags::empty(), ___deadline
5419 )?;
5420 Ok(_response.map(|x| x.attributes))
5421 }
5422
5423 pub fn r#get_player_application_settings(
5427 &self,
5428 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
5429 ___deadline: zx::MonotonicInstant,
5430 ) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
5431 let _response = self.client.send_query::<
5432 TargetHandlerGetPlayerApplicationSettingsRequest,
5433 fidl::encoding::ResultType<TargetHandlerGetPlayerApplicationSettingsResponse, TargetAvcError>,
5434 >(
5435 (attribute_ids,),
5436 0x4273f96bdb752751,
5437 fidl::encoding::DynamicFlags::empty(),
5438 ___deadline,
5439 )?;
5440 Ok(_response.map(|x| x.current_settings))
5441 }
5442
5443 pub fn r#set_player_application_settings(
5451 &self,
5452 mut requested_settings: &PlayerApplicationSettings,
5453 ___deadline: zx::MonotonicInstant,
5454 ) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
5455 let _response = self.client.send_query::<
5456 TargetHandlerSetPlayerApplicationSettingsRequest,
5457 fidl::encoding::ResultType<TargetHandlerSetPlayerApplicationSettingsResponse, TargetAvcError>,
5458 >(
5459 (requested_settings,),
5460 0x636dd18255e01998,
5461 fidl::encoding::DynamicFlags::empty(),
5462 ___deadline,
5463 )?;
5464 Ok(_response.map(|x| x.set_settings))
5465 }
5466
5467 pub fn r#get_notification(
5469 &self,
5470 mut event_id: NotificationEvent,
5471 ___deadline: zx::MonotonicInstant,
5472 ) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
5473 let _response = self.client.send_query::<
5474 TargetHandlerGetNotificationRequest,
5475 fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
5476 >(
5477 (event_id,),
5478 0x60c7792539a032f1,
5479 fidl::encoding::DynamicFlags::empty(),
5480 ___deadline,
5481 )?;
5482 Ok(_response.map(|x| x.current_value))
5483 }
5484
5485 pub fn r#watch_notification(
5491 &self,
5492 mut event_id: NotificationEvent,
5493 mut current: &Notification,
5494 mut pos_change_interval: u32,
5495 ___deadline: zx::MonotonicInstant,
5496 ) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
5497 let _response =
5498 self.client
5499 .send_query::<TargetHandlerWatchNotificationRequest, fidl::encoding::ResultType<
5500 TargetHandlerWatchNotificationResponse,
5501 TargetAvcError,
5502 >>(
5503 (event_id, current, pos_change_interval),
5504 0x2a513434cf256e5f,
5505 fidl::encoding::DynamicFlags::empty(),
5506 ___deadline,
5507 )?;
5508 Ok(_response.map(|x| x.new_value))
5509 }
5510
5511 pub fn r#set_addressed_player(
5513 &self,
5514 mut player_id: &AddressedPlayerId,
5515 ___deadline: zx::MonotonicInstant,
5516 ) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
5517 let _response = self.client.send_query::<
5518 TargetHandlerSetAddressedPlayerRequest,
5519 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
5520 >(
5521 (player_id,),
5522 0x6724ae8288c34d2f,
5523 fidl::encoding::DynamicFlags::empty(),
5524 ___deadline,
5525 )?;
5526 Ok(_response.map(|x| x))
5527 }
5528
5529 pub fn r#get_media_player_items(
5531 &self,
5532 ___deadline: zx::MonotonicInstant,
5533 ) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
5534 let _response =
5535 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5536 TargetHandlerGetMediaPlayerItemsResponse,
5537 TargetAvcError,
5538 >>(
5539 (),
5540 0x736668f5aa3a8246,
5541 fidl::encoding::DynamicFlags::empty(),
5542 ___deadline,
5543 )?;
5544 Ok(_response.map(|x| x.items))
5545 }
5546}
5547
5548#[cfg(target_os = "fuchsia")]
5549impl From<TargetHandlerSynchronousProxy> for zx::Handle {
5550 fn from(value: TargetHandlerSynchronousProxy) -> Self {
5551 value.into_channel().into()
5552 }
5553}
5554
5555#[cfg(target_os = "fuchsia")]
5556impl From<fidl::Channel> for TargetHandlerSynchronousProxy {
5557 fn from(value: fidl::Channel) -> Self {
5558 Self::new(value)
5559 }
5560}
5561
5562#[derive(Debug, Clone)]
5563pub struct TargetHandlerProxy {
5564 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5565}
5566
5567impl fidl::endpoints::Proxy for TargetHandlerProxy {
5568 type Protocol = TargetHandlerMarker;
5569
5570 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5571 Self::new(inner)
5572 }
5573
5574 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5575 self.client.into_channel().map_err(|client| Self { client })
5576 }
5577
5578 fn as_channel(&self) -> &::fidl::AsyncChannel {
5579 self.client.as_channel()
5580 }
5581}
5582
5583impl TargetHandlerProxy {
5584 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5586 let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5587 Self { client: fidl::client::Client::new(channel, protocol_name) }
5588 }
5589
5590 pub fn take_event_stream(&self) -> TargetHandlerEventStream {
5596 TargetHandlerEventStream { event_receiver: self.client.take_event_receiver() }
5597 }
5598
5599 pub fn r#get_events_supported(
5601 &self,
5602 ) -> fidl::client::QueryResponseFut<
5603 TargetHandlerGetEventsSupportedResult,
5604 fidl::encoding::DefaultFuchsiaResourceDialect,
5605 > {
5606 TargetHandlerProxyInterface::r#get_events_supported(self)
5607 }
5608
5609 pub fn r#get_media_attributes(
5613 &self,
5614 ) -> fidl::client::QueryResponseFut<
5615 TargetHandlerGetMediaAttributesResult,
5616 fidl::encoding::DefaultFuchsiaResourceDialect,
5617 > {
5618 TargetHandlerProxyInterface::r#get_media_attributes(self)
5619 }
5620
5621 pub fn r#get_play_status(
5623 &self,
5624 ) -> fidl::client::QueryResponseFut<
5625 TargetHandlerGetPlayStatusResult,
5626 fidl::encoding::DefaultFuchsiaResourceDialect,
5627 > {
5628 TargetHandlerProxyInterface::r#get_play_status(self)
5629 }
5630
5631 pub fn r#send_command(
5635 &self,
5636 mut command: AvcPanelCommand,
5637 mut pressed: bool,
5638 ) -> fidl::client::QueryResponseFut<
5639 TargetHandlerSendCommandResult,
5640 fidl::encoding::DefaultFuchsiaResourceDialect,
5641 > {
5642 TargetHandlerProxyInterface::r#send_command(self, command, pressed)
5643 }
5644
5645 pub fn r#list_player_application_setting_attributes(
5648 &self,
5649 ) -> fidl::client::QueryResponseFut<
5650 TargetHandlerListPlayerApplicationSettingAttributesResult,
5651 fidl::encoding::DefaultFuchsiaResourceDialect,
5652 > {
5653 TargetHandlerProxyInterface::r#list_player_application_setting_attributes(self)
5654 }
5655
5656 pub fn r#get_player_application_settings(
5660 &self,
5661 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
5662 ) -> fidl::client::QueryResponseFut<
5663 TargetHandlerGetPlayerApplicationSettingsResult,
5664 fidl::encoding::DefaultFuchsiaResourceDialect,
5665 > {
5666 TargetHandlerProxyInterface::r#get_player_application_settings(self, attribute_ids)
5667 }
5668
5669 pub fn r#set_player_application_settings(
5677 &self,
5678 mut requested_settings: &PlayerApplicationSettings,
5679 ) -> fidl::client::QueryResponseFut<
5680 TargetHandlerSetPlayerApplicationSettingsResult,
5681 fidl::encoding::DefaultFuchsiaResourceDialect,
5682 > {
5683 TargetHandlerProxyInterface::r#set_player_application_settings(self, requested_settings)
5684 }
5685
5686 pub fn r#get_notification(
5688 &self,
5689 mut event_id: NotificationEvent,
5690 ) -> fidl::client::QueryResponseFut<
5691 TargetHandlerGetNotificationResult,
5692 fidl::encoding::DefaultFuchsiaResourceDialect,
5693 > {
5694 TargetHandlerProxyInterface::r#get_notification(self, event_id)
5695 }
5696
5697 pub fn r#watch_notification(
5703 &self,
5704 mut event_id: NotificationEvent,
5705 mut current: &Notification,
5706 mut pos_change_interval: u32,
5707 ) -> fidl::client::QueryResponseFut<
5708 TargetHandlerWatchNotificationResult,
5709 fidl::encoding::DefaultFuchsiaResourceDialect,
5710 > {
5711 TargetHandlerProxyInterface::r#watch_notification(
5712 self,
5713 event_id,
5714 current,
5715 pos_change_interval,
5716 )
5717 }
5718
5719 pub fn r#set_addressed_player(
5721 &self,
5722 mut player_id: &AddressedPlayerId,
5723 ) -> fidl::client::QueryResponseFut<
5724 TargetHandlerSetAddressedPlayerResult,
5725 fidl::encoding::DefaultFuchsiaResourceDialect,
5726 > {
5727 TargetHandlerProxyInterface::r#set_addressed_player(self, player_id)
5728 }
5729
5730 pub fn r#get_media_player_items(
5732 &self,
5733 ) -> fidl::client::QueryResponseFut<
5734 TargetHandlerGetMediaPlayerItemsResult,
5735 fidl::encoding::DefaultFuchsiaResourceDialect,
5736 > {
5737 TargetHandlerProxyInterface::r#get_media_player_items(self)
5738 }
5739}
5740
5741impl TargetHandlerProxyInterface for TargetHandlerProxy {
5742 type GetEventsSupportedResponseFut = fidl::client::QueryResponseFut<
5743 TargetHandlerGetEventsSupportedResult,
5744 fidl::encoding::DefaultFuchsiaResourceDialect,
5745 >;
5746 fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut {
5747 fn _decode(
5748 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5749 ) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
5750 let _response = fidl::client::decode_transaction_body::<
5751 fidl::encoding::ResultType<TargetHandlerGetEventsSupportedResponse, TargetAvcError>,
5752 fidl::encoding::DefaultFuchsiaResourceDialect,
5753 0x54bb8d817d5e1257,
5754 >(_buf?)?;
5755 Ok(_response.map(|x| x.notification_ids))
5756 }
5757 self.client.send_query_and_decode::<
5758 fidl::encoding::EmptyPayload,
5759 TargetHandlerGetEventsSupportedResult,
5760 >(
5761 (),
5762 0x54bb8d817d5e1257,
5763 fidl::encoding::DynamicFlags::empty(),
5764 _decode,
5765 )
5766 }
5767
5768 type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
5769 TargetHandlerGetMediaAttributesResult,
5770 fidl::encoding::DefaultFuchsiaResourceDialect,
5771 >;
5772 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
5773 fn _decode(
5774 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5775 ) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
5776 let _response = fidl::client::decode_transaction_body::<
5777 fidl::encoding::ResultType<TargetHandlerGetMediaAttributesResponse, TargetAvcError>,
5778 fidl::encoding::DefaultFuchsiaResourceDialect,
5779 0x629f354d2805daf5,
5780 >(_buf?)?;
5781 Ok(_response.map(|x| x.attributes))
5782 }
5783 self.client.send_query_and_decode::<
5784 fidl::encoding::EmptyPayload,
5785 TargetHandlerGetMediaAttributesResult,
5786 >(
5787 (),
5788 0x629f354d2805daf5,
5789 fidl::encoding::DynamicFlags::empty(),
5790 _decode,
5791 )
5792 }
5793
5794 type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
5795 TargetHandlerGetPlayStatusResult,
5796 fidl::encoding::DefaultFuchsiaResourceDialect,
5797 >;
5798 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
5799 fn _decode(
5800 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5801 ) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
5802 let _response = fidl::client::decode_transaction_body::<
5803 fidl::encoding::ResultType<TargetHandlerGetPlayStatusResponse, TargetAvcError>,
5804 fidl::encoding::DefaultFuchsiaResourceDialect,
5805 0x24a4816300e14d89,
5806 >(_buf?)?;
5807 Ok(_response.map(|x| x.play_status))
5808 }
5809 self.client.send_query_and_decode::<
5810 fidl::encoding::EmptyPayload,
5811 TargetHandlerGetPlayStatusResult,
5812 >(
5813 (),
5814 0x24a4816300e14d89,
5815 fidl::encoding::DynamicFlags::empty(),
5816 _decode,
5817 )
5818 }
5819
5820 type SendCommandResponseFut = fidl::client::QueryResponseFut<
5821 TargetHandlerSendCommandResult,
5822 fidl::encoding::DefaultFuchsiaResourceDialect,
5823 >;
5824 fn r#send_command(
5825 &self,
5826 mut command: AvcPanelCommand,
5827 mut pressed: bool,
5828 ) -> Self::SendCommandResponseFut {
5829 fn _decode(
5830 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5831 ) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
5832 let _response = fidl::client::decode_transaction_body::<
5833 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetPassthroughError>,
5834 fidl::encoding::DefaultFuchsiaResourceDialect,
5835 0x69e063a8f6ab7b87,
5836 >(_buf?)?;
5837 Ok(_response.map(|x| x))
5838 }
5839 self.client.send_query_and_decode::<
5840 TargetHandlerSendCommandRequest,
5841 TargetHandlerSendCommandResult,
5842 >(
5843 (command, pressed,),
5844 0x69e063a8f6ab7b87,
5845 fidl::encoding::DynamicFlags::empty(),
5846 _decode,
5847 )
5848 }
5849
5850 type ListPlayerApplicationSettingAttributesResponseFut = fidl::client::QueryResponseFut<
5851 TargetHandlerListPlayerApplicationSettingAttributesResult,
5852 fidl::encoding::DefaultFuchsiaResourceDialect,
5853 >;
5854 fn r#list_player_application_setting_attributes(
5855 &self,
5856 ) -> Self::ListPlayerApplicationSettingAttributesResponseFut {
5857 fn _decode(
5858 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5859 ) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>
5860 {
5861 let _response = fidl::client::decode_transaction_body::<
5862 fidl::encoding::ResultType<
5863 TargetHandlerListPlayerApplicationSettingAttributesResponse,
5864 TargetAvcError,
5865 >,
5866 fidl::encoding::DefaultFuchsiaResourceDialect,
5867 0xdfa38da6a60b2,
5868 >(_buf?)?;
5869 Ok(_response.map(|x| x.attributes))
5870 }
5871 self.client.send_query_and_decode::<
5872 fidl::encoding::EmptyPayload,
5873 TargetHandlerListPlayerApplicationSettingAttributesResult,
5874 >(
5875 (),
5876 0xdfa38da6a60b2,
5877 fidl::encoding::DynamicFlags::empty(),
5878 _decode,
5879 )
5880 }
5881
5882 type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
5883 TargetHandlerGetPlayerApplicationSettingsResult,
5884 fidl::encoding::DefaultFuchsiaResourceDialect,
5885 >;
5886 fn r#get_player_application_settings(
5887 &self,
5888 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
5889 ) -> Self::GetPlayerApplicationSettingsResponseFut {
5890 fn _decode(
5891 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5892 ) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
5893 let _response = fidl::client::decode_transaction_body::<
5894 fidl::encoding::ResultType<
5895 TargetHandlerGetPlayerApplicationSettingsResponse,
5896 TargetAvcError,
5897 >,
5898 fidl::encoding::DefaultFuchsiaResourceDialect,
5899 0x4273f96bdb752751,
5900 >(_buf?)?;
5901 Ok(_response.map(|x| x.current_settings))
5902 }
5903 self.client.send_query_and_decode::<
5904 TargetHandlerGetPlayerApplicationSettingsRequest,
5905 TargetHandlerGetPlayerApplicationSettingsResult,
5906 >(
5907 (attribute_ids,),
5908 0x4273f96bdb752751,
5909 fidl::encoding::DynamicFlags::empty(),
5910 _decode,
5911 )
5912 }
5913
5914 type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
5915 TargetHandlerSetPlayerApplicationSettingsResult,
5916 fidl::encoding::DefaultFuchsiaResourceDialect,
5917 >;
5918 fn r#set_player_application_settings(
5919 &self,
5920 mut requested_settings: &PlayerApplicationSettings,
5921 ) -> Self::SetPlayerApplicationSettingsResponseFut {
5922 fn _decode(
5923 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5924 ) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
5925 let _response = fidl::client::decode_transaction_body::<
5926 fidl::encoding::ResultType<
5927 TargetHandlerSetPlayerApplicationSettingsResponse,
5928 TargetAvcError,
5929 >,
5930 fidl::encoding::DefaultFuchsiaResourceDialect,
5931 0x636dd18255e01998,
5932 >(_buf?)?;
5933 Ok(_response.map(|x| x.set_settings))
5934 }
5935 self.client.send_query_and_decode::<
5936 TargetHandlerSetPlayerApplicationSettingsRequest,
5937 TargetHandlerSetPlayerApplicationSettingsResult,
5938 >(
5939 (requested_settings,),
5940 0x636dd18255e01998,
5941 fidl::encoding::DynamicFlags::empty(),
5942 _decode,
5943 )
5944 }
5945
5946 type GetNotificationResponseFut = fidl::client::QueryResponseFut<
5947 TargetHandlerGetNotificationResult,
5948 fidl::encoding::DefaultFuchsiaResourceDialect,
5949 >;
5950 fn r#get_notification(
5951 &self,
5952 mut event_id: NotificationEvent,
5953 ) -> Self::GetNotificationResponseFut {
5954 fn _decode(
5955 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5956 ) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
5957 let _response = fidl::client::decode_transaction_body::<
5958 fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
5959 fidl::encoding::DefaultFuchsiaResourceDialect,
5960 0x60c7792539a032f1,
5961 >(_buf?)?;
5962 Ok(_response.map(|x| x.current_value))
5963 }
5964 self.client.send_query_and_decode::<
5965 TargetHandlerGetNotificationRequest,
5966 TargetHandlerGetNotificationResult,
5967 >(
5968 (event_id,),
5969 0x60c7792539a032f1,
5970 fidl::encoding::DynamicFlags::empty(),
5971 _decode,
5972 )
5973 }
5974
5975 type WatchNotificationResponseFut = fidl::client::QueryResponseFut<
5976 TargetHandlerWatchNotificationResult,
5977 fidl::encoding::DefaultFuchsiaResourceDialect,
5978 >;
5979 fn r#watch_notification(
5980 &self,
5981 mut event_id: NotificationEvent,
5982 mut current: &Notification,
5983 mut pos_change_interval: u32,
5984 ) -> Self::WatchNotificationResponseFut {
5985 fn _decode(
5986 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5987 ) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
5988 let _response = fidl::client::decode_transaction_body::<
5989 fidl::encoding::ResultType<TargetHandlerWatchNotificationResponse, TargetAvcError>,
5990 fidl::encoding::DefaultFuchsiaResourceDialect,
5991 0x2a513434cf256e5f,
5992 >(_buf?)?;
5993 Ok(_response.map(|x| x.new_value))
5994 }
5995 self.client.send_query_and_decode::<
5996 TargetHandlerWatchNotificationRequest,
5997 TargetHandlerWatchNotificationResult,
5998 >(
5999 (event_id, current, pos_change_interval,),
6000 0x2a513434cf256e5f,
6001 fidl::encoding::DynamicFlags::empty(),
6002 _decode,
6003 )
6004 }
6005
6006 type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
6007 TargetHandlerSetAddressedPlayerResult,
6008 fidl::encoding::DefaultFuchsiaResourceDialect,
6009 >;
6010 fn r#set_addressed_player(
6011 &self,
6012 mut player_id: &AddressedPlayerId,
6013 ) -> Self::SetAddressedPlayerResponseFut {
6014 fn _decode(
6015 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6016 ) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
6017 let _response = fidl::client::decode_transaction_body::<
6018 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
6019 fidl::encoding::DefaultFuchsiaResourceDialect,
6020 0x6724ae8288c34d2f,
6021 >(_buf?)?;
6022 Ok(_response.map(|x| x))
6023 }
6024 self.client.send_query_and_decode::<
6025 TargetHandlerSetAddressedPlayerRequest,
6026 TargetHandlerSetAddressedPlayerResult,
6027 >(
6028 (player_id,),
6029 0x6724ae8288c34d2f,
6030 fidl::encoding::DynamicFlags::empty(),
6031 _decode,
6032 )
6033 }
6034
6035 type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
6036 TargetHandlerGetMediaPlayerItemsResult,
6037 fidl::encoding::DefaultFuchsiaResourceDialect,
6038 >;
6039 fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut {
6040 fn _decode(
6041 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6042 ) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
6043 let _response = fidl::client::decode_transaction_body::<
6044 fidl::encoding::ResultType<
6045 TargetHandlerGetMediaPlayerItemsResponse,
6046 TargetAvcError,
6047 >,
6048 fidl::encoding::DefaultFuchsiaResourceDialect,
6049 0x736668f5aa3a8246,
6050 >(_buf?)?;
6051 Ok(_response.map(|x| x.items))
6052 }
6053 self.client.send_query_and_decode::<
6054 fidl::encoding::EmptyPayload,
6055 TargetHandlerGetMediaPlayerItemsResult,
6056 >(
6057 (),
6058 0x736668f5aa3a8246,
6059 fidl::encoding::DynamicFlags::empty(),
6060 _decode,
6061 )
6062 }
6063}
6064
6065pub struct TargetHandlerEventStream {
6066 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6067}
6068
6069impl std::marker::Unpin for TargetHandlerEventStream {}
6070
6071impl futures::stream::FusedStream for TargetHandlerEventStream {
6072 fn is_terminated(&self) -> bool {
6073 self.event_receiver.is_terminated()
6074 }
6075}
6076
6077impl futures::Stream for TargetHandlerEventStream {
6078 type Item = Result<TargetHandlerEvent, fidl::Error>;
6079
6080 fn poll_next(
6081 mut self: std::pin::Pin<&mut Self>,
6082 cx: &mut std::task::Context<'_>,
6083 ) -> std::task::Poll<Option<Self::Item>> {
6084 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6085 &mut self.event_receiver,
6086 cx
6087 )?) {
6088 Some(buf) => std::task::Poll::Ready(Some(TargetHandlerEvent::decode(buf))),
6089 None => std::task::Poll::Ready(None),
6090 }
6091 }
6092}
6093
6094#[derive(Debug)]
6095pub enum TargetHandlerEvent {}
6096
6097impl TargetHandlerEvent {
6098 fn decode(
6100 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6101 ) -> Result<TargetHandlerEvent, fidl::Error> {
6102 let (bytes, _handles) = buf.split_mut();
6103 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6104 debug_assert_eq!(tx_header.tx_id, 0);
6105 match tx_header.ordinal {
6106 _ => Err(fidl::Error::UnknownOrdinal {
6107 ordinal: tx_header.ordinal,
6108 protocol_name: <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6109 }),
6110 }
6111 }
6112}
6113
6114pub struct TargetHandlerRequestStream {
6116 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6117 is_terminated: bool,
6118}
6119
6120impl std::marker::Unpin for TargetHandlerRequestStream {}
6121
6122impl futures::stream::FusedStream for TargetHandlerRequestStream {
6123 fn is_terminated(&self) -> bool {
6124 self.is_terminated
6125 }
6126}
6127
6128impl fidl::endpoints::RequestStream for TargetHandlerRequestStream {
6129 type Protocol = TargetHandlerMarker;
6130 type ControlHandle = TargetHandlerControlHandle;
6131
6132 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6133 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6134 }
6135
6136 fn control_handle(&self) -> Self::ControlHandle {
6137 TargetHandlerControlHandle { inner: self.inner.clone() }
6138 }
6139
6140 fn into_inner(
6141 self,
6142 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6143 {
6144 (self.inner, self.is_terminated)
6145 }
6146
6147 fn from_inner(
6148 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6149 is_terminated: bool,
6150 ) -> Self {
6151 Self { inner, is_terminated }
6152 }
6153}
6154
6155impl futures::Stream for TargetHandlerRequestStream {
6156 type Item = Result<TargetHandlerRequest, fidl::Error>;
6157
6158 fn poll_next(
6159 mut self: std::pin::Pin<&mut Self>,
6160 cx: &mut std::task::Context<'_>,
6161 ) -> std::task::Poll<Option<Self::Item>> {
6162 let this = &mut *self;
6163 if this.inner.check_shutdown(cx) {
6164 this.is_terminated = true;
6165 return std::task::Poll::Ready(None);
6166 }
6167 if this.is_terminated {
6168 panic!("polled TargetHandlerRequestStream after completion");
6169 }
6170 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6171 |bytes, handles| {
6172 match this.inner.channel().read_etc(cx, bytes, handles) {
6173 std::task::Poll::Ready(Ok(())) => {}
6174 std::task::Poll::Pending => return std::task::Poll::Pending,
6175 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6176 this.is_terminated = true;
6177 return std::task::Poll::Ready(None);
6178 }
6179 std::task::Poll::Ready(Err(e)) => {
6180 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6181 e.into(),
6182 ))))
6183 }
6184 }
6185
6186 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6188
6189 std::task::Poll::Ready(Some(match header.ordinal {
6190 0x54bb8d817d5e1257 => {
6191 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6192 let mut req = fidl::new_empty!(
6193 fidl::encoding::EmptyPayload,
6194 fidl::encoding::DefaultFuchsiaResourceDialect
6195 );
6196 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6197 let control_handle =
6198 TargetHandlerControlHandle { inner: this.inner.clone() };
6199 Ok(TargetHandlerRequest::GetEventsSupported {
6200 responder: TargetHandlerGetEventsSupportedResponder {
6201 control_handle: std::mem::ManuallyDrop::new(control_handle),
6202 tx_id: header.tx_id,
6203 },
6204 })
6205 }
6206 0x629f354d2805daf5 => {
6207 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6208 let mut req = fidl::new_empty!(
6209 fidl::encoding::EmptyPayload,
6210 fidl::encoding::DefaultFuchsiaResourceDialect
6211 );
6212 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6213 let control_handle =
6214 TargetHandlerControlHandle { inner: this.inner.clone() };
6215 Ok(TargetHandlerRequest::GetMediaAttributes {
6216 responder: TargetHandlerGetMediaAttributesResponder {
6217 control_handle: std::mem::ManuallyDrop::new(control_handle),
6218 tx_id: header.tx_id,
6219 },
6220 })
6221 }
6222 0x24a4816300e14d89 => {
6223 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6224 let mut req = fidl::new_empty!(
6225 fidl::encoding::EmptyPayload,
6226 fidl::encoding::DefaultFuchsiaResourceDialect
6227 );
6228 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6229 let control_handle =
6230 TargetHandlerControlHandle { inner: this.inner.clone() };
6231 Ok(TargetHandlerRequest::GetPlayStatus {
6232 responder: TargetHandlerGetPlayStatusResponder {
6233 control_handle: std::mem::ManuallyDrop::new(control_handle),
6234 tx_id: header.tx_id,
6235 },
6236 })
6237 }
6238 0x69e063a8f6ab7b87 => {
6239 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6240 let mut req = fidl::new_empty!(
6241 TargetHandlerSendCommandRequest,
6242 fidl::encoding::DefaultFuchsiaResourceDialect
6243 );
6244 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
6245 let control_handle =
6246 TargetHandlerControlHandle { inner: this.inner.clone() };
6247 Ok(TargetHandlerRequest::SendCommand {
6248 command: req.command,
6249 pressed: req.pressed,
6250
6251 responder: TargetHandlerSendCommandResponder {
6252 control_handle: std::mem::ManuallyDrop::new(control_handle),
6253 tx_id: header.tx_id,
6254 },
6255 })
6256 }
6257 0xdfa38da6a60b2 => {
6258 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6259 let mut req = fidl::new_empty!(
6260 fidl::encoding::EmptyPayload,
6261 fidl::encoding::DefaultFuchsiaResourceDialect
6262 );
6263 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6264 let control_handle =
6265 TargetHandlerControlHandle { inner: this.inner.clone() };
6266 Ok(TargetHandlerRequest::ListPlayerApplicationSettingAttributes {
6267 responder:
6268 TargetHandlerListPlayerApplicationSettingAttributesResponder {
6269 control_handle: std::mem::ManuallyDrop::new(control_handle),
6270 tx_id: header.tx_id,
6271 },
6272 })
6273 }
6274 0x4273f96bdb752751 => {
6275 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6276 let mut req = fidl::new_empty!(
6277 TargetHandlerGetPlayerApplicationSettingsRequest,
6278 fidl::encoding::DefaultFuchsiaResourceDialect
6279 );
6280 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
6281 let control_handle =
6282 TargetHandlerControlHandle { inner: this.inner.clone() };
6283 Ok(TargetHandlerRequest::GetPlayerApplicationSettings {
6284 attribute_ids: req.attribute_ids,
6285
6286 responder: TargetHandlerGetPlayerApplicationSettingsResponder {
6287 control_handle: std::mem::ManuallyDrop::new(control_handle),
6288 tx_id: header.tx_id,
6289 },
6290 })
6291 }
6292 0x636dd18255e01998 => {
6293 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6294 let mut req = fidl::new_empty!(
6295 TargetHandlerSetPlayerApplicationSettingsRequest,
6296 fidl::encoding::DefaultFuchsiaResourceDialect
6297 );
6298 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
6299 let control_handle =
6300 TargetHandlerControlHandle { inner: this.inner.clone() };
6301 Ok(TargetHandlerRequest::SetPlayerApplicationSettings {
6302 requested_settings: req.requested_settings,
6303
6304 responder: TargetHandlerSetPlayerApplicationSettingsResponder {
6305 control_handle: std::mem::ManuallyDrop::new(control_handle),
6306 tx_id: header.tx_id,
6307 },
6308 })
6309 }
6310 0x60c7792539a032f1 => {
6311 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6312 let mut req = fidl::new_empty!(
6313 TargetHandlerGetNotificationRequest,
6314 fidl::encoding::DefaultFuchsiaResourceDialect
6315 );
6316 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
6317 let control_handle =
6318 TargetHandlerControlHandle { inner: this.inner.clone() };
6319 Ok(TargetHandlerRequest::GetNotification {
6320 event_id: req.event_id,
6321
6322 responder: TargetHandlerGetNotificationResponder {
6323 control_handle: std::mem::ManuallyDrop::new(control_handle),
6324 tx_id: header.tx_id,
6325 },
6326 })
6327 }
6328 0x2a513434cf256e5f => {
6329 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6330 let mut req = fidl::new_empty!(
6331 TargetHandlerWatchNotificationRequest,
6332 fidl::encoding::DefaultFuchsiaResourceDialect
6333 );
6334 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerWatchNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
6335 let control_handle =
6336 TargetHandlerControlHandle { inner: this.inner.clone() };
6337 Ok(TargetHandlerRequest::WatchNotification {
6338 event_id: req.event_id,
6339 current: req.current,
6340 pos_change_interval: req.pos_change_interval,
6341
6342 responder: TargetHandlerWatchNotificationResponder {
6343 control_handle: std::mem::ManuallyDrop::new(control_handle),
6344 tx_id: header.tx_id,
6345 },
6346 })
6347 }
6348 0x6724ae8288c34d2f => {
6349 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6350 let mut req = fidl::new_empty!(
6351 TargetHandlerSetAddressedPlayerRequest,
6352 fidl::encoding::DefaultFuchsiaResourceDialect
6353 );
6354 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
6355 let control_handle =
6356 TargetHandlerControlHandle { inner: this.inner.clone() };
6357 Ok(TargetHandlerRequest::SetAddressedPlayer {
6358 player_id: req.player_id,
6359
6360 responder: TargetHandlerSetAddressedPlayerResponder {
6361 control_handle: std::mem::ManuallyDrop::new(control_handle),
6362 tx_id: header.tx_id,
6363 },
6364 })
6365 }
6366 0x736668f5aa3a8246 => {
6367 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6368 let mut req = fidl::new_empty!(
6369 fidl::encoding::EmptyPayload,
6370 fidl::encoding::DefaultFuchsiaResourceDialect
6371 );
6372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6373 let control_handle =
6374 TargetHandlerControlHandle { inner: this.inner.clone() };
6375 Ok(TargetHandlerRequest::GetMediaPlayerItems {
6376 responder: TargetHandlerGetMediaPlayerItemsResponder {
6377 control_handle: std::mem::ManuallyDrop::new(control_handle),
6378 tx_id: header.tx_id,
6379 },
6380 })
6381 }
6382 _ => Err(fidl::Error::UnknownOrdinal {
6383 ordinal: header.ordinal,
6384 protocol_name:
6385 <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6386 }),
6387 }))
6388 },
6389 )
6390 }
6391}
6392
6393#[derive(Debug)]
6396pub enum TargetHandlerRequest {
6397 GetEventsSupported { responder: TargetHandlerGetEventsSupportedResponder },
6399 GetMediaAttributes { responder: TargetHandlerGetMediaAttributesResponder },
6403 GetPlayStatus { responder: TargetHandlerGetPlayStatusResponder },
6405 SendCommand {
6409 command: AvcPanelCommand,
6410 pressed: bool,
6411 responder: TargetHandlerSendCommandResponder,
6412 },
6413 ListPlayerApplicationSettingAttributes {
6416 responder: TargetHandlerListPlayerApplicationSettingAttributesResponder,
6417 },
6418 GetPlayerApplicationSettings {
6422 attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
6423 responder: TargetHandlerGetPlayerApplicationSettingsResponder,
6424 },
6425 SetPlayerApplicationSettings {
6433 requested_settings: PlayerApplicationSettings,
6434 responder: TargetHandlerSetPlayerApplicationSettingsResponder,
6435 },
6436 GetNotification {
6438 event_id: NotificationEvent,
6439 responder: TargetHandlerGetNotificationResponder,
6440 },
6441 WatchNotification {
6447 event_id: NotificationEvent,
6448 current: Notification,
6449 pos_change_interval: u32,
6450 responder: TargetHandlerWatchNotificationResponder,
6451 },
6452 SetAddressedPlayer {
6454 player_id: AddressedPlayerId,
6455 responder: TargetHandlerSetAddressedPlayerResponder,
6456 },
6457 GetMediaPlayerItems { responder: TargetHandlerGetMediaPlayerItemsResponder },
6459}
6460
6461impl TargetHandlerRequest {
6462 #[allow(irrefutable_let_patterns)]
6463 pub fn into_get_events_supported(self) -> Option<(TargetHandlerGetEventsSupportedResponder)> {
6464 if let TargetHandlerRequest::GetEventsSupported { responder } = self {
6465 Some((responder))
6466 } else {
6467 None
6468 }
6469 }
6470
6471 #[allow(irrefutable_let_patterns)]
6472 pub fn into_get_media_attributes(self) -> Option<(TargetHandlerGetMediaAttributesResponder)> {
6473 if let TargetHandlerRequest::GetMediaAttributes { responder } = self {
6474 Some((responder))
6475 } else {
6476 None
6477 }
6478 }
6479
6480 #[allow(irrefutable_let_patterns)]
6481 pub fn into_get_play_status(self) -> Option<(TargetHandlerGetPlayStatusResponder)> {
6482 if let TargetHandlerRequest::GetPlayStatus { responder } = self {
6483 Some((responder))
6484 } else {
6485 None
6486 }
6487 }
6488
6489 #[allow(irrefutable_let_patterns)]
6490 pub fn into_send_command(
6491 self,
6492 ) -> Option<(AvcPanelCommand, bool, TargetHandlerSendCommandResponder)> {
6493 if let TargetHandlerRequest::SendCommand { command, pressed, responder } = self {
6494 Some((command, pressed, responder))
6495 } else {
6496 None
6497 }
6498 }
6499
6500 #[allow(irrefutable_let_patterns)]
6501 pub fn into_list_player_application_setting_attributes(
6502 self,
6503 ) -> Option<(TargetHandlerListPlayerApplicationSettingAttributesResponder)> {
6504 if let TargetHandlerRequest::ListPlayerApplicationSettingAttributes { responder } = self {
6505 Some((responder))
6506 } else {
6507 None
6508 }
6509 }
6510
6511 #[allow(irrefutable_let_patterns)]
6512 pub fn into_get_player_application_settings(
6513 self,
6514 ) -> Option<(
6515 Vec<PlayerApplicationSettingAttributeId>,
6516 TargetHandlerGetPlayerApplicationSettingsResponder,
6517 )> {
6518 if let TargetHandlerRequest::GetPlayerApplicationSettings { attribute_ids, responder } =
6519 self
6520 {
6521 Some((attribute_ids, responder))
6522 } else {
6523 None
6524 }
6525 }
6526
6527 #[allow(irrefutable_let_patterns)]
6528 pub fn into_set_player_application_settings(
6529 self,
6530 ) -> Option<(PlayerApplicationSettings, TargetHandlerSetPlayerApplicationSettingsResponder)>
6531 {
6532 if let TargetHandlerRequest::SetPlayerApplicationSettings {
6533 requested_settings,
6534 responder,
6535 } = self
6536 {
6537 Some((requested_settings, responder))
6538 } else {
6539 None
6540 }
6541 }
6542
6543 #[allow(irrefutable_let_patterns)]
6544 pub fn into_get_notification(
6545 self,
6546 ) -> Option<(NotificationEvent, TargetHandlerGetNotificationResponder)> {
6547 if let TargetHandlerRequest::GetNotification { event_id, responder } = self {
6548 Some((event_id, responder))
6549 } else {
6550 None
6551 }
6552 }
6553
6554 #[allow(irrefutable_let_patterns)]
6555 pub fn into_watch_notification(
6556 self,
6557 ) -> Option<(NotificationEvent, Notification, u32, TargetHandlerWatchNotificationResponder)>
6558 {
6559 if let TargetHandlerRequest::WatchNotification {
6560 event_id,
6561 current,
6562 pos_change_interval,
6563 responder,
6564 } = self
6565 {
6566 Some((event_id, current, pos_change_interval, responder))
6567 } else {
6568 None
6569 }
6570 }
6571
6572 #[allow(irrefutable_let_patterns)]
6573 pub fn into_set_addressed_player(
6574 self,
6575 ) -> Option<(AddressedPlayerId, TargetHandlerSetAddressedPlayerResponder)> {
6576 if let TargetHandlerRequest::SetAddressedPlayer { player_id, responder } = self {
6577 Some((player_id, responder))
6578 } else {
6579 None
6580 }
6581 }
6582
6583 #[allow(irrefutable_let_patterns)]
6584 pub fn into_get_media_player_items(
6585 self,
6586 ) -> Option<(TargetHandlerGetMediaPlayerItemsResponder)> {
6587 if let TargetHandlerRequest::GetMediaPlayerItems { responder } = self {
6588 Some((responder))
6589 } else {
6590 None
6591 }
6592 }
6593
6594 pub fn method_name(&self) -> &'static str {
6596 match *self {
6597 TargetHandlerRequest::GetEventsSupported { .. } => "get_events_supported",
6598 TargetHandlerRequest::GetMediaAttributes { .. } => "get_media_attributes",
6599 TargetHandlerRequest::GetPlayStatus { .. } => "get_play_status",
6600 TargetHandlerRequest::SendCommand { .. } => "send_command",
6601 TargetHandlerRequest::ListPlayerApplicationSettingAttributes { .. } => {
6602 "list_player_application_setting_attributes"
6603 }
6604 TargetHandlerRequest::GetPlayerApplicationSettings { .. } => {
6605 "get_player_application_settings"
6606 }
6607 TargetHandlerRequest::SetPlayerApplicationSettings { .. } => {
6608 "set_player_application_settings"
6609 }
6610 TargetHandlerRequest::GetNotification { .. } => "get_notification",
6611 TargetHandlerRequest::WatchNotification { .. } => "watch_notification",
6612 TargetHandlerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
6613 TargetHandlerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
6614 }
6615 }
6616}
6617
6618#[derive(Debug, Clone)]
6619pub struct TargetHandlerControlHandle {
6620 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6621}
6622
6623impl fidl::endpoints::ControlHandle for TargetHandlerControlHandle {
6624 fn shutdown(&self) {
6625 self.inner.shutdown()
6626 }
6627 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6628 self.inner.shutdown_with_epitaph(status)
6629 }
6630
6631 fn is_closed(&self) -> bool {
6632 self.inner.channel().is_closed()
6633 }
6634 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6635 self.inner.channel().on_closed()
6636 }
6637
6638 #[cfg(target_os = "fuchsia")]
6639 fn signal_peer(
6640 &self,
6641 clear_mask: zx::Signals,
6642 set_mask: zx::Signals,
6643 ) -> Result<(), zx_status::Status> {
6644 use fidl::Peered;
6645 self.inner.channel().signal_peer(clear_mask, set_mask)
6646 }
6647}
6648
6649impl TargetHandlerControlHandle {}
6650
6651#[must_use = "FIDL methods require a response to be sent"]
6652#[derive(Debug)]
6653pub struct TargetHandlerGetEventsSupportedResponder {
6654 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
6655 tx_id: u32,
6656}
6657
6658impl std::ops::Drop for TargetHandlerGetEventsSupportedResponder {
6662 fn drop(&mut self) {
6663 self.control_handle.shutdown();
6664 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6666 }
6667}
6668
6669impl fidl::endpoints::Responder for TargetHandlerGetEventsSupportedResponder {
6670 type ControlHandle = TargetHandlerControlHandle;
6671
6672 fn control_handle(&self) -> &TargetHandlerControlHandle {
6673 &self.control_handle
6674 }
6675
6676 fn drop_without_shutdown(mut self) {
6677 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6679 std::mem::forget(self);
6681 }
6682}
6683
6684impl TargetHandlerGetEventsSupportedResponder {
6685 pub fn send(
6689 self,
6690 mut result: Result<&[NotificationEvent], TargetAvcError>,
6691 ) -> Result<(), fidl::Error> {
6692 let _result = self.send_raw(result);
6693 if _result.is_err() {
6694 self.control_handle.shutdown();
6695 }
6696 self.drop_without_shutdown();
6697 _result
6698 }
6699
6700 pub fn send_no_shutdown_on_err(
6702 self,
6703 mut result: Result<&[NotificationEvent], TargetAvcError>,
6704 ) -> Result<(), fidl::Error> {
6705 let _result = self.send_raw(result);
6706 self.drop_without_shutdown();
6707 _result
6708 }
6709
6710 fn send_raw(
6711 &self,
6712 mut result: Result<&[NotificationEvent], TargetAvcError>,
6713 ) -> Result<(), fidl::Error> {
6714 self.control_handle.inner.send::<fidl::encoding::ResultType<
6715 TargetHandlerGetEventsSupportedResponse,
6716 TargetAvcError,
6717 >>(
6718 result.map(|notification_ids| (notification_ids,)),
6719 self.tx_id,
6720 0x54bb8d817d5e1257,
6721 fidl::encoding::DynamicFlags::empty(),
6722 )
6723 }
6724}
6725
6726#[must_use = "FIDL methods require a response to be sent"]
6727#[derive(Debug)]
6728pub struct TargetHandlerGetMediaAttributesResponder {
6729 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
6730 tx_id: u32,
6731}
6732
6733impl std::ops::Drop for TargetHandlerGetMediaAttributesResponder {
6737 fn drop(&mut self) {
6738 self.control_handle.shutdown();
6739 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6741 }
6742}
6743
6744impl fidl::endpoints::Responder for TargetHandlerGetMediaAttributesResponder {
6745 type ControlHandle = TargetHandlerControlHandle;
6746
6747 fn control_handle(&self) -> &TargetHandlerControlHandle {
6748 &self.control_handle
6749 }
6750
6751 fn drop_without_shutdown(mut self) {
6752 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6754 std::mem::forget(self);
6756 }
6757}
6758
6759impl TargetHandlerGetMediaAttributesResponder {
6760 pub fn send(
6764 self,
6765 mut result: Result<&MediaAttributes, TargetAvcError>,
6766 ) -> Result<(), fidl::Error> {
6767 let _result = self.send_raw(result);
6768 if _result.is_err() {
6769 self.control_handle.shutdown();
6770 }
6771 self.drop_without_shutdown();
6772 _result
6773 }
6774
6775 pub fn send_no_shutdown_on_err(
6777 self,
6778 mut result: Result<&MediaAttributes, TargetAvcError>,
6779 ) -> Result<(), fidl::Error> {
6780 let _result = self.send_raw(result);
6781 self.drop_without_shutdown();
6782 _result
6783 }
6784
6785 fn send_raw(
6786 &self,
6787 mut result: Result<&MediaAttributes, TargetAvcError>,
6788 ) -> Result<(), fidl::Error> {
6789 self.control_handle.inner.send::<fidl::encoding::ResultType<
6790 TargetHandlerGetMediaAttributesResponse,
6791 TargetAvcError,
6792 >>(
6793 result.map(|attributes| (attributes,)),
6794 self.tx_id,
6795 0x629f354d2805daf5,
6796 fidl::encoding::DynamicFlags::empty(),
6797 )
6798 }
6799}
6800
6801#[must_use = "FIDL methods require a response to be sent"]
6802#[derive(Debug)]
6803pub struct TargetHandlerGetPlayStatusResponder {
6804 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
6805 tx_id: u32,
6806}
6807
6808impl std::ops::Drop for TargetHandlerGetPlayStatusResponder {
6812 fn drop(&mut self) {
6813 self.control_handle.shutdown();
6814 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6816 }
6817}
6818
6819impl fidl::endpoints::Responder for TargetHandlerGetPlayStatusResponder {
6820 type ControlHandle = TargetHandlerControlHandle;
6821
6822 fn control_handle(&self) -> &TargetHandlerControlHandle {
6823 &self.control_handle
6824 }
6825
6826 fn drop_without_shutdown(mut self) {
6827 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6829 std::mem::forget(self);
6831 }
6832}
6833
6834impl TargetHandlerGetPlayStatusResponder {
6835 pub fn send(self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
6839 let _result = self.send_raw(result);
6840 if _result.is_err() {
6841 self.control_handle.shutdown();
6842 }
6843 self.drop_without_shutdown();
6844 _result
6845 }
6846
6847 pub fn send_no_shutdown_on_err(
6849 self,
6850 mut result: Result<&PlayStatus, TargetAvcError>,
6851 ) -> Result<(), fidl::Error> {
6852 let _result = self.send_raw(result);
6853 self.drop_without_shutdown();
6854 _result
6855 }
6856
6857 fn send_raw(&self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
6858 self.control_handle.inner.send::<fidl::encoding::ResultType<
6859 TargetHandlerGetPlayStatusResponse,
6860 TargetAvcError,
6861 >>(
6862 result.map(|play_status| (play_status,)),
6863 self.tx_id,
6864 0x24a4816300e14d89,
6865 fidl::encoding::DynamicFlags::empty(),
6866 )
6867 }
6868}
6869
6870#[must_use = "FIDL methods require a response to be sent"]
6871#[derive(Debug)]
6872pub struct TargetHandlerSendCommandResponder {
6873 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
6874 tx_id: u32,
6875}
6876
6877impl std::ops::Drop for TargetHandlerSendCommandResponder {
6881 fn drop(&mut self) {
6882 self.control_handle.shutdown();
6883 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6885 }
6886}
6887
6888impl fidl::endpoints::Responder for TargetHandlerSendCommandResponder {
6889 type ControlHandle = TargetHandlerControlHandle;
6890
6891 fn control_handle(&self) -> &TargetHandlerControlHandle {
6892 &self.control_handle
6893 }
6894
6895 fn drop_without_shutdown(mut self) {
6896 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6898 std::mem::forget(self);
6900 }
6901}
6902
6903impl TargetHandlerSendCommandResponder {
6904 pub fn send(self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
6908 let _result = self.send_raw(result);
6909 if _result.is_err() {
6910 self.control_handle.shutdown();
6911 }
6912 self.drop_without_shutdown();
6913 _result
6914 }
6915
6916 pub fn send_no_shutdown_on_err(
6918 self,
6919 mut result: Result<(), TargetPassthroughError>,
6920 ) -> Result<(), fidl::Error> {
6921 let _result = self.send_raw(result);
6922 self.drop_without_shutdown();
6923 _result
6924 }
6925
6926 fn send_raw(&self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
6927 self.control_handle.inner.send::<fidl::encoding::ResultType<
6928 fidl::encoding::EmptyStruct,
6929 TargetPassthroughError,
6930 >>(
6931 result,
6932 self.tx_id,
6933 0x69e063a8f6ab7b87,
6934 fidl::encoding::DynamicFlags::empty(),
6935 )
6936 }
6937}
6938
6939#[must_use = "FIDL methods require a response to be sent"]
6940#[derive(Debug)]
6941pub struct TargetHandlerListPlayerApplicationSettingAttributesResponder {
6942 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
6943 tx_id: u32,
6944}
6945
6946impl std::ops::Drop for TargetHandlerListPlayerApplicationSettingAttributesResponder {
6950 fn drop(&mut self) {
6951 self.control_handle.shutdown();
6952 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6954 }
6955}
6956
6957impl fidl::endpoints::Responder for TargetHandlerListPlayerApplicationSettingAttributesResponder {
6958 type ControlHandle = TargetHandlerControlHandle;
6959
6960 fn control_handle(&self) -> &TargetHandlerControlHandle {
6961 &self.control_handle
6962 }
6963
6964 fn drop_without_shutdown(mut self) {
6965 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6967 std::mem::forget(self);
6969 }
6970}
6971
6972impl TargetHandlerListPlayerApplicationSettingAttributesResponder {
6973 pub fn send(
6977 self,
6978 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
6979 ) -> Result<(), fidl::Error> {
6980 let _result = self.send_raw(result);
6981 if _result.is_err() {
6982 self.control_handle.shutdown();
6983 }
6984 self.drop_without_shutdown();
6985 _result
6986 }
6987
6988 pub fn send_no_shutdown_on_err(
6990 self,
6991 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
6992 ) -> Result<(), fidl::Error> {
6993 let _result = self.send_raw(result);
6994 self.drop_without_shutdown();
6995 _result
6996 }
6997
6998 fn send_raw(
6999 &self,
7000 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
7001 ) -> Result<(), fidl::Error> {
7002 self.control_handle.inner.send::<fidl::encoding::ResultType<
7003 TargetHandlerListPlayerApplicationSettingAttributesResponse,
7004 TargetAvcError,
7005 >>(
7006 result.map(|attributes| (attributes,)),
7007 self.tx_id,
7008 0xdfa38da6a60b2,
7009 fidl::encoding::DynamicFlags::empty(),
7010 )
7011 }
7012}
7013
7014#[must_use = "FIDL methods require a response to be sent"]
7015#[derive(Debug)]
7016pub struct TargetHandlerGetPlayerApplicationSettingsResponder {
7017 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7018 tx_id: u32,
7019}
7020
7021impl std::ops::Drop for TargetHandlerGetPlayerApplicationSettingsResponder {
7025 fn drop(&mut self) {
7026 self.control_handle.shutdown();
7027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7029 }
7030}
7031
7032impl fidl::endpoints::Responder for TargetHandlerGetPlayerApplicationSettingsResponder {
7033 type ControlHandle = TargetHandlerControlHandle;
7034
7035 fn control_handle(&self) -> &TargetHandlerControlHandle {
7036 &self.control_handle
7037 }
7038
7039 fn drop_without_shutdown(mut self) {
7040 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7042 std::mem::forget(self);
7044 }
7045}
7046
7047impl TargetHandlerGetPlayerApplicationSettingsResponder {
7048 pub fn send(
7052 self,
7053 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7054 ) -> Result<(), fidl::Error> {
7055 let _result = self.send_raw(result);
7056 if _result.is_err() {
7057 self.control_handle.shutdown();
7058 }
7059 self.drop_without_shutdown();
7060 _result
7061 }
7062
7063 pub fn send_no_shutdown_on_err(
7065 self,
7066 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7067 ) -> Result<(), fidl::Error> {
7068 let _result = self.send_raw(result);
7069 self.drop_without_shutdown();
7070 _result
7071 }
7072
7073 fn send_raw(
7074 &self,
7075 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7076 ) -> Result<(), fidl::Error> {
7077 self.control_handle.inner.send::<fidl::encoding::ResultType<
7078 TargetHandlerGetPlayerApplicationSettingsResponse,
7079 TargetAvcError,
7080 >>(
7081 result.map(|current_settings| (current_settings,)),
7082 self.tx_id,
7083 0x4273f96bdb752751,
7084 fidl::encoding::DynamicFlags::empty(),
7085 )
7086 }
7087}
7088
7089#[must_use = "FIDL methods require a response to be sent"]
7090#[derive(Debug)]
7091pub struct TargetHandlerSetPlayerApplicationSettingsResponder {
7092 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7093 tx_id: u32,
7094}
7095
7096impl std::ops::Drop for TargetHandlerSetPlayerApplicationSettingsResponder {
7100 fn drop(&mut self) {
7101 self.control_handle.shutdown();
7102 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7104 }
7105}
7106
7107impl fidl::endpoints::Responder for TargetHandlerSetPlayerApplicationSettingsResponder {
7108 type ControlHandle = TargetHandlerControlHandle;
7109
7110 fn control_handle(&self) -> &TargetHandlerControlHandle {
7111 &self.control_handle
7112 }
7113
7114 fn drop_without_shutdown(mut self) {
7115 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7117 std::mem::forget(self);
7119 }
7120}
7121
7122impl TargetHandlerSetPlayerApplicationSettingsResponder {
7123 pub fn send(
7127 self,
7128 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7129 ) -> Result<(), fidl::Error> {
7130 let _result = self.send_raw(result);
7131 if _result.is_err() {
7132 self.control_handle.shutdown();
7133 }
7134 self.drop_without_shutdown();
7135 _result
7136 }
7137
7138 pub fn send_no_shutdown_on_err(
7140 self,
7141 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7142 ) -> Result<(), fidl::Error> {
7143 let _result = self.send_raw(result);
7144 self.drop_without_shutdown();
7145 _result
7146 }
7147
7148 fn send_raw(
7149 &self,
7150 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
7151 ) -> Result<(), fidl::Error> {
7152 self.control_handle.inner.send::<fidl::encoding::ResultType<
7153 TargetHandlerSetPlayerApplicationSettingsResponse,
7154 TargetAvcError,
7155 >>(
7156 result.map(|set_settings| (set_settings,)),
7157 self.tx_id,
7158 0x636dd18255e01998,
7159 fidl::encoding::DynamicFlags::empty(),
7160 )
7161 }
7162}
7163
7164#[must_use = "FIDL methods require a response to be sent"]
7165#[derive(Debug)]
7166pub struct TargetHandlerGetNotificationResponder {
7167 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7168 tx_id: u32,
7169}
7170
7171impl std::ops::Drop for TargetHandlerGetNotificationResponder {
7175 fn drop(&mut self) {
7176 self.control_handle.shutdown();
7177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7179 }
7180}
7181
7182impl fidl::endpoints::Responder for TargetHandlerGetNotificationResponder {
7183 type ControlHandle = TargetHandlerControlHandle;
7184
7185 fn control_handle(&self) -> &TargetHandlerControlHandle {
7186 &self.control_handle
7187 }
7188
7189 fn drop_without_shutdown(mut self) {
7190 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7192 std::mem::forget(self);
7194 }
7195}
7196
7197impl TargetHandlerGetNotificationResponder {
7198 pub fn send(
7202 self,
7203 mut result: Result<&Notification, TargetAvcError>,
7204 ) -> Result<(), fidl::Error> {
7205 let _result = self.send_raw(result);
7206 if _result.is_err() {
7207 self.control_handle.shutdown();
7208 }
7209 self.drop_without_shutdown();
7210 _result
7211 }
7212
7213 pub fn send_no_shutdown_on_err(
7215 self,
7216 mut result: Result<&Notification, TargetAvcError>,
7217 ) -> Result<(), fidl::Error> {
7218 let _result = self.send_raw(result);
7219 self.drop_without_shutdown();
7220 _result
7221 }
7222
7223 fn send_raw(
7224 &self,
7225 mut result: Result<&Notification, TargetAvcError>,
7226 ) -> Result<(), fidl::Error> {
7227 self.control_handle.inner.send::<fidl::encoding::ResultType<
7228 TargetHandlerGetNotificationResponse,
7229 TargetAvcError,
7230 >>(
7231 result.map(|current_value| (current_value,)),
7232 self.tx_id,
7233 0x60c7792539a032f1,
7234 fidl::encoding::DynamicFlags::empty(),
7235 )
7236 }
7237}
7238
7239#[must_use = "FIDL methods require a response to be sent"]
7240#[derive(Debug)]
7241pub struct TargetHandlerWatchNotificationResponder {
7242 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7243 tx_id: u32,
7244}
7245
7246impl std::ops::Drop for TargetHandlerWatchNotificationResponder {
7250 fn drop(&mut self) {
7251 self.control_handle.shutdown();
7252 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7254 }
7255}
7256
7257impl fidl::endpoints::Responder for TargetHandlerWatchNotificationResponder {
7258 type ControlHandle = TargetHandlerControlHandle;
7259
7260 fn control_handle(&self) -> &TargetHandlerControlHandle {
7261 &self.control_handle
7262 }
7263
7264 fn drop_without_shutdown(mut self) {
7265 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7267 std::mem::forget(self);
7269 }
7270}
7271
7272impl TargetHandlerWatchNotificationResponder {
7273 pub fn send(
7277 self,
7278 mut result: Result<&Notification, TargetAvcError>,
7279 ) -> Result<(), fidl::Error> {
7280 let _result = self.send_raw(result);
7281 if _result.is_err() {
7282 self.control_handle.shutdown();
7283 }
7284 self.drop_without_shutdown();
7285 _result
7286 }
7287
7288 pub fn send_no_shutdown_on_err(
7290 self,
7291 mut result: Result<&Notification, TargetAvcError>,
7292 ) -> Result<(), fidl::Error> {
7293 let _result = self.send_raw(result);
7294 self.drop_without_shutdown();
7295 _result
7296 }
7297
7298 fn send_raw(
7299 &self,
7300 mut result: Result<&Notification, TargetAvcError>,
7301 ) -> Result<(), fidl::Error> {
7302 self.control_handle.inner.send::<fidl::encoding::ResultType<
7303 TargetHandlerWatchNotificationResponse,
7304 TargetAvcError,
7305 >>(
7306 result.map(|new_value| (new_value,)),
7307 self.tx_id,
7308 0x2a513434cf256e5f,
7309 fidl::encoding::DynamicFlags::empty(),
7310 )
7311 }
7312}
7313
7314#[must_use = "FIDL methods require a response to be sent"]
7315#[derive(Debug)]
7316pub struct TargetHandlerSetAddressedPlayerResponder {
7317 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7318 tx_id: u32,
7319}
7320
7321impl std::ops::Drop for TargetHandlerSetAddressedPlayerResponder {
7325 fn drop(&mut self) {
7326 self.control_handle.shutdown();
7327 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7329 }
7330}
7331
7332impl fidl::endpoints::Responder for TargetHandlerSetAddressedPlayerResponder {
7333 type ControlHandle = TargetHandlerControlHandle;
7334
7335 fn control_handle(&self) -> &TargetHandlerControlHandle {
7336 &self.control_handle
7337 }
7338
7339 fn drop_without_shutdown(mut self) {
7340 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7342 std::mem::forget(self);
7344 }
7345}
7346
7347impl TargetHandlerSetAddressedPlayerResponder {
7348 pub fn send(self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
7352 let _result = self.send_raw(result);
7353 if _result.is_err() {
7354 self.control_handle.shutdown();
7355 }
7356 self.drop_without_shutdown();
7357 _result
7358 }
7359
7360 pub fn send_no_shutdown_on_err(
7362 self,
7363 mut result: Result<(), TargetAvcError>,
7364 ) -> Result<(), fidl::Error> {
7365 let _result = self.send_raw(result);
7366 self.drop_without_shutdown();
7367 _result
7368 }
7369
7370 fn send_raw(&self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
7371 self.control_handle.inner.send::<fidl::encoding::ResultType<
7372 fidl::encoding::EmptyStruct,
7373 TargetAvcError,
7374 >>(
7375 result,
7376 self.tx_id,
7377 0x6724ae8288c34d2f,
7378 fidl::encoding::DynamicFlags::empty(),
7379 )
7380 }
7381}
7382
7383#[must_use = "FIDL methods require a response to be sent"]
7384#[derive(Debug)]
7385pub struct TargetHandlerGetMediaPlayerItemsResponder {
7386 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
7387 tx_id: u32,
7388}
7389
7390impl std::ops::Drop for TargetHandlerGetMediaPlayerItemsResponder {
7394 fn drop(&mut self) {
7395 self.control_handle.shutdown();
7396 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7398 }
7399}
7400
7401impl fidl::endpoints::Responder for TargetHandlerGetMediaPlayerItemsResponder {
7402 type ControlHandle = TargetHandlerControlHandle;
7403
7404 fn control_handle(&self) -> &TargetHandlerControlHandle {
7405 &self.control_handle
7406 }
7407
7408 fn drop_without_shutdown(mut self) {
7409 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7411 std::mem::forget(self);
7413 }
7414}
7415
7416impl TargetHandlerGetMediaPlayerItemsResponder {
7417 pub fn send(
7421 self,
7422 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
7423 ) -> Result<(), fidl::Error> {
7424 let _result = self.send_raw(result);
7425 if _result.is_err() {
7426 self.control_handle.shutdown();
7427 }
7428 self.drop_without_shutdown();
7429 _result
7430 }
7431
7432 pub fn send_no_shutdown_on_err(
7434 self,
7435 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
7436 ) -> Result<(), fidl::Error> {
7437 let _result = self.send_raw(result);
7438 self.drop_without_shutdown();
7439 _result
7440 }
7441
7442 fn send_raw(
7443 &self,
7444 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
7445 ) -> Result<(), fidl::Error> {
7446 self.control_handle.inner.send::<fidl::encoding::ResultType<
7447 TargetHandlerGetMediaPlayerItemsResponse,
7448 TargetAvcError,
7449 >>(
7450 result.map(|items| (items,)),
7451 self.tx_id,
7452 0x736668f5aa3a8246,
7453 fidl::encoding::DynamicFlags::empty(),
7454 )
7455 }
7456}
7457
7458mod internal {
7459 use super::*;
7460
7461 impl fidl::encoding::ResourceTypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
7462 type Borrowed<'a> = &'a mut Self;
7463 fn take_or_borrow<'a>(
7464 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7465 ) -> Self::Borrowed<'a> {
7466 value
7467 }
7468 }
7469
7470 unsafe impl fidl::encoding::TypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
7471 type Owned = Self;
7472
7473 #[inline(always)]
7474 fn inline_align(_context: fidl::encoding::Context) -> usize {
7475 8
7476 }
7477
7478 #[inline(always)]
7479 fn inline_size(_context: fidl::encoding::Context) -> usize {
7480 16
7481 }
7482 }
7483
7484 unsafe impl
7485 fidl::encoding::Encode<
7486 PeerManagerGetBrowseControllerForTargetRequest,
7487 fidl::encoding::DefaultFuchsiaResourceDialect,
7488 > for &mut PeerManagerGetBrowseControllerForTargetRequest
7489 {
7490 #[inline]
7491 unsafe fn encode(
7492 self,
7493 encoder: &mut fidl::encoding::Encoder<
7494 '_,
7495 fidl::encoding::DefaultFuchsiaResourceDialect,
7496 >,
7497 offset: usize,
7498 _depth: fidl::encoding::Depth,
7499 ) -> fidl::Result<()> {
7500 encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
7501 fidl::encoding::Encode::<PeerManagerGetBrowseControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7503 (
7504 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
7505 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
7506 ),
7507 encoder, offset, _depth
7508 )
7509 }
7510 }
7511 unsafe impl<
7512 T0: fidl::encoding::Encode<
7513 fidl_fuchsia_bluetooth::PeerId,
7514 fidl::encoding::DefaultFuchsiaResourceDialect,
7515 >,
7516 T1: fidl::encoding::Encode<
7517 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
7518 fidl::encoding::DefaultFuchsiaResourceDialect,
7519 >,
7520 >
7521 fidl::encoding::Encode<
7522 PeerManagerGetBrowseControllerForTargetRequest,
7523 fidl::encoding::DefaultFuchsiaResourceDialect,
7524 > for (T0, T1)
7525 {
7526 #[inline]
7527 unsafe fn encode(
7528 self,
7529 encoder: &mut fidl::encoding::Encoder<
7530 '_,
7531 fidl::encoding::DefaultFuchsiaResourceDialect,
7532 >,
7533 offset: usize,
7534 depth: fidl::encoding::Depth,
7535 ) -> fidl::Result<()> {
7536 encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
7537 unsafe {
7540 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7541 (ptr as *mut u64).write_unaligned(0);
7542 }
7543 self.0.encode(encoder, offset + 0, depth)?;
7545 self.1.encode(encoder, offset + 8, depth)?;
7546 Ok(())
7547 }
7548 }
7549
7550 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7551 for PeerManagerGetBrowseControllerForTargetRequest
7552 {
7553 #[inline(always)]
7554 fn new_empty() -> Self {
7555 Self {
7556 peer_id: fidl::new_empty!(
7557 fidl_fuchsia_bluetooth::PeerId,
7558 fidl::encoding::DefaultFuchsiaResourceDialect
7559 ),
7560 client: fidl::new_empty!(
7561 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
7562 fidl::encoding::DefaultFuchsiaResourceDialect
7563 ),
7564 }
7565 }
7566
7567 #[inline]
7568 unsafe fn decode(
7569 &mut self,
7570 decoder: &mut fidl::encoding::Decoder<
7571 '_,
7572 fidl::encoding::DefaultFuchsiaResourceDialect,
7573 >,
7574 offset: usize,
7575 _depth: fidl::encoding::Depth,
7576 ) -> fidl::Result<()> {
7577 decoder.debug_check_bounds::<Self>(offset);
7578 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
7580 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7581 let mask = 0xffffffff00000000u64;
7582 let maskedval = padval & mask;
7583 if maskedval != 0 {
7584 return Err(fidl::Error::NonZeroPadding {
7585 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7586 });
7587 }
7588 fidl::decode!(
7589 fidl_fuchsia_bluetooth::PeerId,
7590 fidl::encoding::DefaultFuchsiaResourceDialect,
7591 &mut self.peer_id,
7592 decoder,
7593 offset + 0,
7594 _depth
7595 )?;
7596 fidl::decode!(
7597 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
7598 fidl::encoding::DefaultFuchsiaResourceDialect,
7599 &mut self.client,
7600 decoder,
7601 offset + 8,
7602 _depth
7603 )?;
7604 Ok(())
7605 }
7606 }
7607
7608 impl fidl::encoding::ResourceTypeMarker for PeerManagerGetControllerForTargetRequest {
7609 type Borrowed<'a> = &'a mut Self;
7610 fn take_or_borrow<'a>(
7611 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7612 ) -> Self::Borrowed<'a> {
7613 value
7614 }
7615 }
7616
7617 unsafe impl fidl::encoding::TypeMarker for PeerManagerGetControllerForTargetRequest {
7618 type Owned = Self;
7619
7620 #[inline(always)]
7621 fn inline_align(_context: fidl::encoding::Context) -> usize {
7622 8
7623 }
7624
7625 #[inline(always)]
7626 fn inline_size(_context: fidl::encoding::Context) -> usize {
7627 16
7628 }
7629 }
7630
7631 unsafe impl
7632 fidl::encoding::Encode<
7633 PeerManagerGetControllerForTargetRequest,
7634 fidl::encoding::DefaultFuchsiaResourceDialect,
7635 > for &mut PeerManagerGetControllerForTargetRequest
7636 {
7637 #[inline]
7638 unsafe fn encode(
7639 self,
7640 encoder: &mut fidl::encoding::Encoder<
7641 '_,
7642 fidl::encoding::DefaultFuchsiaResourceDialect,
7643 >,
7644 offset: usize,
7645 _depth: fidl::encoding::Depth,
7646 ) -> fidl::Result<()> {
7647 encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
7648 fidl::encoding::Encode::<PeerManagerGetControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7650 (
7651 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
7652 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
7653 ),
7654 encoder, offset, _depth
7655 )
7656 }
7657 }
7658 unsafe impl<
7659 T0: fidl::encoding::Encode<
7660 fidl_fuchsia_bluetooth::PeerId,
7661 fidl::encoding::DefaultFuchsiaResourceDialect,
7662 >,
7663 T1: fidl::encoding::Encode<
7664 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
7665 fidl::encoding::DefaultFuchsiaResourceDialect,
7666 >,
7667 >
7668 fidl::encoding::Encode<
7669 PeerManagerGetControllerForTargetRequest,
7670 fidl::encoding::DefaultFuchsiaResourceDialect,
7671 > for (T0, T1)
7672 {
7673 #[inline]
7674 unsafe fn encode(
7675 self,
7676 encoder: &mut fidl::encoding::Encoder<
7677 '_,
7678 fidl::encoding::DefaultFuchsiaResourceDialect,
7679 >,
7680 offset: usize,
7681 depth: fidl::encoding::Depth,
7682 ) -> fidl::Result<()> {
7683 encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
7684 unsafe {
7687 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7688 (ptr as *mut u64).write_unaligned(0);
7689 }
7690 self.0.encode(encoder, offset + 0, depth)?;
7692 self.1.encode(encoder, offset + 8, depth)?;
7693 Ok(())
7694 }
7695 }
7696
7697 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7698 for PeerManagerGetControllerForTargetRequest
7699 {
7700 #[inline(always)]
7701 fn new_empty() -> Self {
7702 Self {
7703 peer_id: fidl::new_empty!(
7704 fidl_fuchsia_bluetooth::PeerId,
7705 fidl::encoding::DefaultFuchsiaResourceDialect
7706 ),
7707 client: fidl::new_empty!(
7708 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
7709 fidl::encoding::DefaultFuchsiaResourceDialect
7710 ),
7711 }
7712 }
7713
7714 #[inline]
7715 unsafe fn decode(
7716 &mut self,
7717 decoder: &mut fidl::encoding::Decoder<
7718 '_,
7719 fidl::encoding::DefaultFuchsiaResourceDialect,
7720 >,
7721 offset: usize,
7722 _depth: fidl::encoding::Depth,
7723 ) -> fidl::Result<()> {
7724 decoder.debug_check_bounds::<Self>(offset);
7725 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
7727 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7728 let mask = 0xffffffff00000000u64;
7729 let maskedval = padval & mask;
7730 if maskedval != 0 {
7731 return Err(fidl::Error::NonZeroPadding {
7732 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7733 });
7734 }
7735 fidl::decode!(
7736 fidl_fuchsia_bluetooth::PeerId,
7737 fidl::encoding::DefaultFuchsiaResourceDialect,
7738 &mut self.peer_id,
7739 decoder,
7740 offset + 0,
7741 _depth
7742 )?;
7743 fidl::decode!(
7744 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
7745 fidl::encoding::DefaultFuchsiaResourceDialect,
7746 &mut self.client,
7747 decoder,
7748 offset + 8,
7749 _depth
7750 )?;
7751 Ok(())
7752 }
7753 }
7754
7755 impl fidl::encoding::ResourceTypeMarker for PeerManagerRegisterTargetHandlerRequest {
7756 type Borrowed<'a> = &'a mut Self;
7757 fn take_or_borrow<'a>(
7758 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7759 ) -> Self::Borrowed<'a> {
7760 value
7761 }
7762 }
7763
7764 unsafe impl fidl::encoding::TypeMarker for PeerManagerRegisterTargetHandlerRequest {
7765 type Owned = Self;
7766
7767 #[inline(always)]
7768 fn inline_align(_context: fidl::encoding::Context) -> usize {
7769 4
7770 }
7771
7772 #[inline(always)]
7773 fn inline_size(_context: fidl::encoding::Context) -> usize {
7774 4
7775 }
7776 }
7777
7778 unsafe impl
7779 fidl::encoding::Encode<
7780 PeerManagerRegisterTargetHandlerRequest,
7781 fidl::encoding::DefaultFuchsiaResourceDialect,
7782 > for &mut PeerManagerRegisterTargetHandlerRequest
7783 {
7784 #[inline]
7785 unsafe fn encode(
7786 self,
7787 encoder: &mut fidl::encoding::Encoder<
7788 '_,
7789 fidl::encoding::DefaultFuchsiaResourceDialect,
7790 >,
7791 offset: usize,
7792 _depth: fidl::encoding::Depth,
7793 ) -> fidl::Result<()> {
7794 encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
7795 fidl::encoding::Encode::<PeerManagerRegisterTargetHandlerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7797 (
7798 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handler),
7799 ),
7800 encoder, offset, _depth
7801 )
7802 }
7803 }
7804 unsafe impl<
7805 T0: fidl::encoding::Encode<
7806 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
7807 fidl::encoding::DefaultFuchsiaResourceDialect,
7808 >,
7809 >
7810 fidl::encoding::Encode<
7811 PeerManagerRegisterTargetHandlerRequest,
7812 fidl::encoding::DefaultFuchsiaResourceDialect,
7813 > for (T0,)
7814 {
7815 #[inline]
7816 unsafe fn encode(
7817 self,
7818 encoder: &mut fidl::encoding::Encoder<
7819 '_,
7820 fidl::encoding::DefaultFuchsiaResourceDialect,
7821 >,
7822 offset: usize,
7823 depth: fidl::encoding::Depth,
7824 ) -> fidl::Result<()> {
7825 encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
7826 self.0.encode(encoder, offset + 0, depth)?;
7830 Ok(())
7831 }
7832 }
7833
7834 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7835 for PeerManagerRegisterTargetHandlerRequest
7836 {
7837 #[inline(always)]
7838 fn new_empty() -> Self {
7839 Self {
7840 handler: fidl::new_empty!(
7841 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
7842 fidl::encoding::DefaultFuchsiaResourceDialect
7843 ),
7844 }
7845 }
7846
7847 #[inline]
7848 unsafe fn decode(
7849 &mut self,
7850 decoder: &mut fidl::encoding::Decoder<
7851 '_,
7852 fidl::encoding::DefaultFuchsiaResourceDialect,
7853 >,
7854 offset: usize,
7855 _depth: fidl::encoding::Depth,
7856 ) -> fidl::Result<()> {
7857 decoder.debug_check_bounds::<Self>(offset);
7858 fidl::decode!(
7860 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
7861 fidl::encoding::DefaultFuchsiaResourceDialect,
7862 &mut self.handler,
7863 decoder,
7864 offset + 0,
7865 _depth
7866 )?;
7867 Ok(())
7868 }
7869 }
7870
7871 impl fidl::encoding::ResourceTypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
7872 type Borrowed<'a> = &'a mut Self;
7873 fn take_or_borrow<'a>(
7874 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7875 ) -> Self::Borrowed<'a> {
7876 value
7877 }
7878 }
7879
7880 unsafe impl fidl::encoding::TypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
7881 type Owned = Self;
7882
7883 #[inline(always)]
7884 fn inline_align(_context: fidl::encoding::Context) -> usize {
7885 4
7886 }
7887
7888 #[inline(always)]
7889 fn inline_size(_context: fidl::encoding::Context) -> usize {
7890 4
7891 }
7892 }
7893
7894 unsafe impl
7895 fidl::encoding::Encode<
7896 PeerManagerSetAbsoluteVolumeHandlerRequest,
7897 fidl::encoding::DefaultFuchsiaResourceDialect,
7898 > for &mut PeerManagerSetAbsoluteVolumeHandlerRequest
7899 {
7900 #[inline]
7901 unsafe fn encode(
7902 self,
7903 encoder: &mut fidl::encoding::Encoder<
7904 '_,
7905 fidl::encoding::DefaultFuchsiaResourceDialect,
7906 >,
7907 offset: usize,
7908 _depth: fidl::encoding::Depth,
7909 ) -> fidl::Result<()> {
7910 encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
7911 fidl::encoding::Encode::<
7913 PeerManagerSetAbsoluteVolumeHandlerRequest,
7914 fidl::encoding::DefaultFuchsiaResourceDialect,
7915 >::encode(
7916 (
7917 <fidl::encoding::Endpoint<
7918 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
7919 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7920 &mut self.handler
7921 ),
7922 ),
7923 encoder,
7924 offset,
7925 _depth,
7926 )
7927 }
7928 }
7929 unsafe impl<
7930 T0: fidl::encoding::Encode<
7931 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
7932 fidl::encoding::DefaultFuchsiaResourceDialect,
7933 >,
7934 >
7935 fidl::encoding::Encode<
7936 PeerManagerSetAbsoluteVolumeHandlerRequest,
7937 fidl::encoding::DefaultFuchsiaResourceDialect,
7938 > for (T0,)
7939 {
7940 #[inline]
7941 unsafe fn encode(
7942 self,
7943 encoder: &mut fidl::encoding::Encoder<
7944 '_,
7945 fidl::encoding::DefaultFuchsiaResourceDialect,
7946 >,
7947 offset: usize,
7948 depth: fidl::encoding::Depth,
7949 ) -> fidl::Result<()> {
7950 encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
7951 self.0.encode(encoder, offset + 0, depth)?;
7955 Ok(())
7956 }
7957 }
7958
7959 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7960 for PeerManagerSetAbsoluteVolumeHandlerRequest
7961 {
7962 #[inline(always)]
7963 fn new_empty() -> Self {
7964 Self {
7965 handler: fidl::new_empty!(
7966 fidl::encoding::Endpoint<
7967 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
7968 >,
7969 fidl::encoding::DefaultFuchsiaResourceDialect
7970 ),
7971 }
7972 }
7973
7974 #[inline]
7975 unsafe fn decode(
7976 &mut self,
7977 decoder: &mut fidl::encoding::Decoder<
7978 '_,
7979 fidl::encoding::DefaultFuchsiaResourceDialect,
7980 >,
7981 offset: usize,
7982 _depth: fidl::encoding::Depth,
7983 ) -> fidl::Result<()> {
7984 decoder.debug_check_bounds::<Self>(offset);
7985 fidl::decode!(
7987 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
7988 fidl::encoding::DefaultFuchsiaResourceDialect,
7989 &mut self.handler,
7990 decoder,
7991 offset + 0,
7992 _depth
7993 )?;
7994 Ok(())
7995 }
7996 }
7997}