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__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct ChannelMarker;
16
17impl fidl::endpoints::ProtocolMarker for ChannelMarker {
18 type Proxy = ChannelProxy;
19 type RequestStream = ChannelRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = ChannelSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "(anonymous) Channel";
24}
25
26pub trait ChannelProxyInterface: Send + Sync {
27 type Send_ResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
28 fn r#send_(&self, packets: &[Packet]) -> Self::Send_ResponseFut;
29 type ReceiveResponseFut: std::future::Future<Output = Result<Vec<Packet>, fidl::Error>> + Send;
30 fn r#receive(&self) -> Self::ReceiveResponseFut;
31 type WatchChannelParametersResponseFut: std::future::Future<Output = Result<ChannelParameters, fidl::Error>>
32 + Send;
33 fn r#watch_channel_parameters(&self) -> Self::WatchChannelParametersResponseFut;
34}
35#[derive(Debug)]
36#[cfg(target_os = "fuchsia")]
37pub struct ChannelSynchronousProxy {
38 client: fidl::client::sync::Client,
39}
40
41#[cfg(target_os = "fuchsia")]
42impl fidl::endpoints::SynchronousProxy for ChannelSynchronousProxy {
43 type Proxy = ChannelProxy;
44 type Protocol = ChannelMarker;
45
46 fn from_channel(inner: fidl::Channel) -> Self {
47 Self::new(inner)
48 }
49
50 fn into_channel(self) -> fidl::Channel {
51 self.client.into_channel()
52 }
53
54 fn as_channel(&self) -> &fidl::Channel {
55 self.client.as_channel()
56 }
57}
58
59#[cfg(target_os = "fuchsia")]
60impl ChannelSynchronousProxy {
61 pub fn new(channel: fidl::Channel) -> Self {
62 Self { client: fidl::client::sync::Client::new(channel) }
63 }
64
65 pub fn into_channel(self) -> fidl::Channel {
66 self.client.into_channel()
67 }
68
69 pub fn wait_for_event(
72 &self,
73 deadline: zx::MonotonicInstant,
74 ) -> Result<ChannelEvent, fidl::Error> {
75 ChannelEvent::decode(self.client.wait_for_event::<ChannelMarker>(deadline)?)
76 }
77
78 pub fn r#send_(
81 &self,
82 mut packets: &[Packet],
83 ___deadline: zx::MonotonicInstant,
84 ) -> Result<(), fidl::Error> {
85 let _response = self.client.send_query::<
86 ChannelSendRequest,
87 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
88 ChannelMarker,
89 >(
90 (packets,),
91 0x6fc4419c2e763324,
92 fidl::encoding::DynamicFlags::FLEXIBLE,
93 ___deadline,
94 )?
95 .into_result::<ChannelMarker>("send_")?;
96 Ok(_response)
97 }
98
99 pub fn r#receive(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Packet>, fidl::Error> {
102 let _response = self.client.send_query::<
103 fidl::encoding::EmptyPayload,
104 fidl::encoding::FlexibleType<ChannelReceiveResponse>,
105 ChannelMarker,
106 >(
107 (),
108 0x3498d7bdb7cdbfd4,
109 fidl::encoding::DynamicFlags::FLEXIBLE,
110 ___deadline,
111 )?
112 .into_result::<ChannelMarker>("receive")?;
113 Ok(_response.packets)
114 }
115
116 pub fn r#watch_channel_parameters(
129 &self,
130 ___deadline: zx::MonotonicInstant,
131 ) -> Result<ChannelParameters, fidl::Error> {
132 let _response = self.client.send_query::<
133 fidl::encoding::EmptyPayload,
134 fidl::encoding::FlexibleType<ChannelParameters>,
135 ChannelMarker,
136 >(
137 (),
138 0x5a0cec81d5076c12,
139 fidl::encoding::DynamicFlags::FLEXIBLE,
140 ___deadline,
141 )?
142 .into_result::<ChannelMarker>("watch_channel_parameters")?;
143 Ok(_response)
144 }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl From<ChannelSynchronousProxy> for zx::NullableHandle {
149 fn from(value: ChannelSynchronousProxy) -> Self {
150 value.into_channel().into()
151 }
152}
153
154#[cfg(target_os = "fuchsia")]
155impl From<fidl::Channel> for ChannelSynchronousProxy {
156 fn from(value: fidl::Channel) -> Self {
157 Self::new(value)
158 }
159}
160
161#[cfg(target_os = "fuchsia")]
162impl fidl::endpoints::FromClient for ChannelSynchronousProxy {
163 type Protocol = ChannelMarker;
164
165 fn from_client(value: fidl::endpoints::ClientEnd<ChannelMarker>) -> Self {
166 Self::new(value.into_channel())
167 }
168}
169
170#[derive(Debug, Clone)]
171pub struct ChannelProxy {
172 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
173}
174
175impl fidl::endpoints::Proxy for ChannelProxy {
176 type Protocol = ChannelMarker;
177
178 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
179 Self::new(inner)
180 }
181
182 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
183 self.client.into_channel().map_err(|client| Self { client })
184 }
185
186 fn as_channel(&self) -> &::fidl::AsyncChannel {
187 self.client.as_channel()
188 }
189}
190
191impl ChannelProxy {
192 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
194 let protocol_name = <ChannelMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
195 Self { client: fidl::client::Client::new(channel, protocol_name) }
196 }
197
198 pub fn take_event_stream(&self) -> ChannelEventStream {
204 ChannelEventStream { event_receiver: self.client.take_event_receiver() }
205 }
206
207 pub fn r#send_(
210 &self,
211 mut packets: &[Packet],
212 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
213 ChannelProxyInterface::r#send_(self, packets)
214 }
215
216 pub fn r#receive(
219 &self,
220 ) -> fidl::client::QueryResponseFut<Vec<Packet>, fidl::encoding::DefaultFuchsiaResourceDialect>
221 {
222 ChannelProxyInterface::r#receive(self)
223 }
224
225 pub fn r#watch_channel_parameters(
238 &self,
239 ) -> fidl::client::QueryResponseFut<
240 ChannelParameters,
241 fidl::encoding::DefaultFuchsiaResourceDialect,
242 > {
243 ChannelProxyInterface::r#watch_channel_parameters(self)
244 }
245}
246
247impl ChannelProxyInterface for ChannelProxy {
248 type Send_ResponseFut =
249 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
250 fn r#send_(&self, mut packets: &[Packet]) -> Self::Send_ResponseFut {
251 fn _decode(
252 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
253 ) -> Result<(), fidl::Error> {
254 let _response = fidl::client::decode_transaction_body::<
255 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
256 fidl::encoding::DefaultFuchsiaResourceDialect,
257 0x6fc4419c2e763324,
258 >(_buf?)?
259 .into_result::<ChannelMarker>("send_")?;
260 Ok(_response)
261 }
262 self.client.send_query_and_decode::<ChannelSendRequest, ()>(
263 (packets,),
264 0x6fc4419c2e763324,
265 fidl::encoding::DynamicFlags::FLEXIBLE,
266 _decode,
267 )
268 }
269
270 type ReceiveResponseFut =
271 fidl::client::QueryResponseFut<Vec<Packet>, fidl::encoding::DefaultFuchsiaResourceDialect>;
272 fn r#receive(&self) -> Self::ReceiveResponseFut {
273 fn _decode(
274 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
275 ) -> Result<Vec<Packet>, fidl::Error> {
276 let _response = fidl::client::decode_transaction_body::<
277 fidl::encoding::FlexibleType<ChannelReceiveResponse>,
278 fidl::encoding::DefaultFuchsiaResourceDialect,
279 0x3498d7bdb7cdbfd4,
280 >(_buf?)?
281 .into_result::<ChannelMarker>("receive")?;
282 Ok(_response.packets)
283 }
284 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Packet>>(
285 (),
286 0x3498d7bdb7cdbfd4,
287 fidl::encoding::DynamicFlags::FLEXIBLE,
288 _decode,
289 )
290 }
291
292 type WatchChannelParametersResponseFut = fidl::client::QueryResponseFut<
293 ChannelParameters,
294 fidl::encoding::DefaultFuchsiaResourceDialect,
295 >;
296 fn r#watch_channel_parameters(&self) -> Self::WatchChannelParametersResponseFut {
297 fn _decode(
298 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
299 ) -> Result<ChannelParameters, fidl::Error> {
300 let _response = fidl::client::decode_transaction_body::<
301 fidl::encoding::FlexibleType<ChannelParameters>,
302 fidl::encoding::DefaultFuchsiaResourceDialect,
303 0x5a0cec81d5076c12,
304 >(_buf?)?
305 .into_result::<ChannelMarker>("watch_channel_parameters")?;
306 Ok(_response)
307 }
308 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ChannelParameters>(
309 (),
310 0x5a0cec81d5076c12,
311 fidl::encoding::DynamicFlags::FLEXIBLE,
312 _decode,
313 )
314 }
315}
316
317pub struct ChannelEventStream {
318 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
319}
320
321impl std::marker::Unpin for ChannelEventStream {}
322
323impl futures::stream::FusedStream for ChannelEventStream {
324 fn is_terminated(&self) -> bool {
325 self.event_receiver.is_terminated()
326 }
327}
328
329impl futures::Stream for ChannelEventStream {
330 type Item = Result<ChannelEvent, fidl::Error>;
331
332 fn poll_next(
333 mut self: std::pin::Pin<&mut Self>,
334 cx: &mut std::task::Context<'_>,
335 ) -> std::task::Poll<Option<Self::Item>> {
336 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
337 &mut self.event_receiver,
338 cx
339 )?) {
340 Some(buf) => std::task::Poll::Ready(Some(ChannelEvent::decode(buf))),
341 None => std::task::Poll::Ready(None),
342 }
343 }
344}
345
346#[derive(Debug)]
347pub enum ChannelEvent {
348 #[non_exhaustive]
349 _UnknownEvent {
350 ordinal: u64,
352 },
353}
354
355impl ChannelEvent {
356 fn decode(
358 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
359 ) -> Result<ChannelEvent, fidl::Error> {
360 let (bytes, _handles) = buf.split_mut();
361 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
362 debug_assert_eq!(tx_header.tx_id, 0);
363 match tx_header.ordinal {
364 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
365 Ok(ChannelEvent::_UnknownEvent { ordinal: tx_header.ordinal })
366 }
367 _ => Err(fidl::Error::UnknownOrdinal {
368 ordinal: tx_header.ordinal,
369 protocol_name: <ChannelMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
370 }),
371 }
372 }
373}
374
375pub struct ChannelRequestStream {
377 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
378 is_terminated: bool,
379}
380
381impl std::marker::Unpin for ChannelRequestStream {}
382
383impl futures::stream::FusedStream for ChannelRequestStream {
384 fn is_terminated(&self) -> bool {
385 self.is_terminated
386 }
387}
388
389impl fidl::endpoints::RequestStream for ChannelRequestStream {
390 type Protocol = ChannelMarker;
391 type ControlHandle = ChannelControlHandle;
392
393 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
394 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
395 }
396
397 fn control_handle(&self) -> Self::ControlHandle {
398 ChannelControlHandle { inner: self.inner.clone() }
399 }
400
401 fn into_inner(
402 self,
403 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
404 {
405 (self.inner, self.is_terminated)
406 }
407
408 fn from_inner(
409 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
410 is_terminated: bool,
411 ) -> Self {
412 Self { inner, is_terminated }
413 }
414}
415
416impl futures::Stream for ChannelRequestStream {
417 type Item = Result<ChannelRequest, fidl::Error>;
418
419 fn poll_next(
420 mut self: std::pin::Pin<&mut Self>,
421 cx: &mut std::task::Context<'_>,
422 ) -> std::task::Poll<Option<Self::Item>> {
423 let this = &mut *self;
424 if this.inner.check_shutdown(cx) {
425 this.is_terminated = true;
426 return std::task::Poll::Ready(None);
427 }
428 if this.is_terminated {
429 panic!("polled ChannelRequestStream after completion");
430 }
431 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
432 |bytes, handles| {
433 match this.inner.channel().read_etc(cx, bytes, handles) {
434 std::task::Poll::Ready(Ok(())) => {}
435 std::task::Poll::Pending => return std::task::Poll::Pending,
436 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
437 this.is_terminated = true;
438 return std::task::Poll::Ready(None);
439 }
440 std::task::Poll::Ready(Err(e)) => {
441 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
442 e.into(),
443 ))));
444 }
445 }
446
447 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
449
450 std::task::Poll::Ready(Some(match header.ordinal {
451 0x6fc4419c2e763324 => {
452 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
453 let mut req = fidl::new_empty!(
454 ChannelSendRequest,
455 fidl::encoding::DefaultFuchsiaResourceDialect
456 );
457 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ChannelSendRequest>(&header, _body_bytes, handles, &mut req)?;
458 let control_handle = ChannelControlHandle { inner: this.inner.clone() };
459 Ok(ChannelRequest::Send_ {
460 packets: req.packets,
461
462 responder: ChannelSend_Responder {
463 control_handle: std::mem::ManuallyDrop::new(control_handle),
464 tx_id: header.tx_id,
465 },
466 })
467 }
468 0x3498d7bdb7cdbfd4 => {
469 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
470 let mut req = fidl::new_empty!(
471 fidl::encoding::EmptyPayload,
472 fidl::encoding::DefaultFuchsiaResourceDialect
473 );
474 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
475 let control_handle = ChannelControlHandle { inner: this.inner.clone() };
476 Ok(ChannelRequest::Receive {
477 responder: ChannelReceiveResponder {
478 control_handle: std::mem::ManuallyDrop::new(control_handle),
479 tx_id: header.tx_id,
480 },
481 })
482 }
483 0x5a0cec81d5076c12 => {
484 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
485 let mut req = fidl::new_empty!(
486 fidl::encoding::EmptyPayload,
487 fidl::encoding::DefaultFuchsiaResourceDialect
488 );
489 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
490 let control_handle = ChannelControlHandle { inner: this.inner.clone() };
491 Ok(ChannelRequest::WatchChannelParameters {
492 responder: ChannelWatchChannelParametersResponder {
493 control_handle: std::mem::ManuallyDrop::new(control_handle),
494 tx_id: header.tx_id,
495 },
496 })
497 }
498 _ if header.tx_id == 0
499 && header
500 .dynamic_flags()
501 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
502 {
503 Ok(ChannelRequest::_UnknownMethod {
504 ordinal: header.ordinal,
505 control_handle: ChannelControlHandle { inner: this.inner.clone() },
506 method_type: fidl::MethodType::OneWay,
507 })
508 }
509 _ if header
510 .dynamic_flags()
511 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
512 {
513 this.inner.send_framework_err(
514 fidl::encoding::FrameworkErr::UnknownMethod,
515 header.tx_id,
516 header.ordinal,
517 header.dynamic_flags(),
518 (bytes, handles),
519 )?;
520 Ok(ChannelRequest::_UnknownMethod {
521 ordinal: header.ordinal,
522 control_handle: ChannelControlHandle { inner: this.inner.clone() },
523 method_type: fidl::MethodType::TwoWay,
524 })
525 }
526 _ => Err(fidl::Error::UnknownOrdinal {
527 ordinal: header.ordinal,
528 protocol_name:
529 <ChannelMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
530 }),
531 }))
532 },
533 )
534 }
535}
536
537#[derive(Debug)]
542pub enum ChannelRequest {
543 Send_ { packets: Vec<Packet>, responder: ChannelSend_Responder },
546 Receive { responder: ChannelReceiveResponder },
549 WatchChannelParameters { responder: ChannelWatchChannelParametersResponder },
562 #[non_exhaustive]
564 _UnknownMethod {
565 ordinal: u64,
567 control_handle: ChannelControlHandle,
568 method_type: fidl::MethodType,
569 },
570}
571
572impl ChannelRequest {
573 #[allow(irrefutable_let_patterns)]
574 pub fn into_send_(self) -> Option<(Vec<Packet>, ChannelSend_Responder)> {
575 if let ChannelRequest::Send_ { packets, responder } = self {
576 Some((packets, responder))
577 } else {
578 None
579 }
580 }
581
582 #[allow(irrefutable_let_patterns)]
583 pub fn into_receive(self) -> Option<(ChannelReceiveResponder)> {
584 if let ChannelRequest::Receive { responder } = self { Some((responder)) } else { None }
585 }
586
587 #[allow(irrefutable_let_patterns)]
588 pub fn into_watch_channel_parameters(self) -> Option<(ChannelWatchChannelParametersResponder)> {
589 if let ChannelRequest::WatchChannelParameters { responder } = self {
590 Some((responder))
591 } else {
592 None
593 }
594 }
595
596 pub fn method_name(&self) -> &'static str {
598 match *self {
599 ChannelRequest::Send_ { .. } => "send_",
600 ChannelRequest::Receive { .. } => "receive",
601 ChannelRequest::WatchChannelParameters { .. } => "watch_channel_parameters",
602 ChannelRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
603 "unknown one-way method"
604 }
605 ChannelRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
606 "unknown two-way method"
607 }
608 }
609 }
610}
611
612#[derive(Debug, Clone)]
613pub struct ChannelControlHandle {
614 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
615}
616
617impl fidl::endpoints::ControlHandle for ChannelControlHandle {
618 fn shutdown(&self) {
619 self.inner.shutdown()
620 }
621
622 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
623 self.inner.shutdown_with_epitaph(status)
624 }
625
626 fn is_closed(&self) -> bool {
627 self.inner.channel().is_closed()
628 }
629 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
630 self.inner.channel().on_closed()
631 }
632
633 #[cfg(target_os = "fuchsia")]
634 fn signal_peer(
635 &self,
636 clear_mask: zx::Signals,
637 set_mask: zx::Signals,
638 ) -> Result<(), zx_status::Status> {
639 use fidl::Peered;
640 self.inner.channel().signal_peer(clear_mask, set_mask)
641 }
642}
643
644impl ChannelControlHandle {}
645
646#[must_use = "FIDL methods require a response to be sent"]
647#[derive(Debug)]
648pub struct ChannelSend_Responder {
649 control_handle: std::mem::ManuallyDrop<ChannelControlHandle>,
650 tx_id: u32,
651}
652
653impl std::ops::Drop for ChannelSend_Responder {
657 fn drop(&mut self) {
658 self.control_handle.shutdown();
659 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
661 }
662}
663
664impl fidl::endpoints::Responder for ChannelSend_Responder {
665 type ControlHandle = ChannelControlHandle;
666
667 fn control_handle(&self) -> &ChannelControlHandle {
668 &self.control_handle
669 }
670
671 fn drop_without_shutdown(mut self) {
672 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
674 std::mem::forget(self);
676 }
677}
678
679impl ChannelSend_Responder {
680 pub fn send(self) -> Result<(), fidl::Error> {
684 let _result = self.send_raw();
685 if _result.is_err() {
686 self.control_handle.shutdown();
687 }
688 self.drop_without_shutdown();
689 _result
690 }
691
692 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
694 let _result = self.send_raw();
695 self.drop_without_shutdown();
696 _result
697 }
698
699 fn send_raw(&self) -> Result<(), fidl::Error> {
700 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
701 fidl::encoding::Flexible::new(()),
702 self.tx_id,
703 0x6fc4419c2e763324,
704 fidl::encoding::DynamicFlags::FLEXIBLE,
705 )
706 }
707}
708
709#[must_use = "FIDL methods require a response to be sent"]
710#[derive(Debug)]
711pub struct ChannelReceiveResponder {
712 control_handle: std::mem::ManuallyDrop<ChannelControlHandle>,
713 tx_id: u32,
714}
715
716impl std::ops::Drop for ChannelReceiveResponder {
720 fn drop(&mut self) {
721 self.control_handle.shutdown();
722 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
724 }
725}
726
727impl fidl::endpoints::Responder for ChannelReceiveResponder {
728 type ControlHandle = ChannelControlHandle;
729
730 fn control_handle(&self) -> &ChannelControlHandle {
731 &self.control_handle
732 }
733
734 fn drop_without_shutdown(mut self) {
735 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
737 std::mem::forget(self);
739 }
740}
741
742impl ChannelReceiveResponder {
743 pub fn send(self, mut packets: &[Packet]) -> Result<(), fidl::Error> {
747 let _result = self.send_raw(packets);
748 if _result.is_err() {
749 self.control_handle.shutdown();
750 }
751 self.drop_without_shutdown();
752 _result
753 }
754
755 pub fn send_no_shutdown_on_err(self, mut packets: &[Packet]) -> Result<(), fidl::Error> {
757 let _result = self.send_raw(packets);
758 self.drop_without_shutdown();
759 _result
760 }
761
762 fn send_raw(&self, mut packets: &[Packet]) -> Result<(), fidl::Error> {
763 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ChannelReceiveResponse>>(
764 fidl::encoding::Flexible::new((packets,)),
765 self.tx_id,
766 0x3498d7bdb7cdbfd4,
767 fidl::encoding::DynamicFlags::FLEXIBLE,
768 )
769 }
770}
771
772#[must_use = "FIDL methods require a response to be sent"]
773#[derive(Debug)]
774pub struct ChannelWatchChannelParametersResponder {
775 control_handle: std::mem::ManuallyDrop<ChannelControlHandle>,
776 tx_id: u32,
777}
778
779impl std::ops::Drop for ChannelWatchChannelParametersResponder {
783 fn drop(&mut self) {
784 self.control_handle.shutdown();
785 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
787 }
788}
789
790impl fidl::endpoints::Responder for ChannelWatchChannelParametersResponder {
791 type ControlHandle = ChannelControlHandle;
792
793 fn control_handle(&self) -> &ChannelControlHandle {
794 &self.control_handle
795 }
796
797 fn drop_without_shutdown(mut self) {
798 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
800 std::mem::forget(self);
802 }
803}
804
805impl ChannelWatchChannelParametersResponder {
806 pub fn send(self, mut payload: &ChannelParameters) -> Result<(), fidl::Error> {
810 let _result = self.send_raw(payload);
811 if _result.is_err() {
812 self.control_handle.shutdown();
813 }
814 self.drop_without_shutdown();
815 _result
816 }
817
818 pub fn send_no_shutdown_on_err(
820 self,
821 mut payload: &ChannelParameters,
822 ) -> Result<(), fidl::Error> {
823 let _result = self.send_raw(payload);
824 self.drop_without_shutdown();
825 _result
826 }
827
828 fn send_raw(&self, mut payload: &ChannelParameters) -> Result<(), fidl::Error> {
829 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ChannelParameters>>(
830 fidl::encoding::Flexible::new(payload),
831 self.tx_id,
832 0x5a0cec81d5076c12,
833 fidl::encoding::DynamicFlags::FLEXIBLE,
834 )
835 }
836}
837
838mod internal {
839 use super::*;
840}