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_driver_index_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DevelopmentManagerGetCompositeNodeSpecsRequest {
16 pub name_filter: Option<String>,
17 pub iterator: fidl::endpoints::ServerEnd<
18 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
19 >,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
23 for DevelopmentManagerGetCompositeNodeSpecsRequest
24{
25}
26
27#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28pub struct DevelopmentManagerGetDriverInfoRequest {
29 pub driver_filter: Vec<String>,
30 pub iterator:
31 fidl::endpoints::ServerEnd<fidl_fuchsia_driver_development::DriverInfoIteratorMarker>,
32}
33
34impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
35 for DevelopmentManagerGetDriverInfoRequest
36{
37}
38
39#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
40pub struct DriverIndexSetNotifierRequest {
41 pub notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
42}
43
44impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
45 for DriverIndexSetNotifierRequest
46{
47}
48
49#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
50pub struct DevelopmentManagerMarker;
51
52impl fidl::endpoints::ProtocolMarker for DevelopmentManagerMarker {
53 type Proxy = DevelopmentManagerProxy;
54 type RequestStream = DevelopmentManagerRequestStream;
55 #[cfg(target_os = "fuchsia")]
56 type SynchronousProxy = DevelopmentManagerSynchronousProxy;
57
58 const DEBUG_NAME: &'static str = "fuchsia.driver.index.DevelopmentManager";
59}
60impl fidl::endpoints::DiscoverableProtocolMarker for DevelopmentManagerMarker {}
61pub type DevelopmentManagerDisableDriverResult = Result<(), i32>;
62pub type DevelopmentManagerEnableDriverResult = Result<(), i32>;
63pub type DevelopmentManagerRebindCompositesWithDriverResult = Result<(), i32>;
64
65pub trait DevelopmentManagerProxyInterface: Send + Sync {
66 fn r#get_driver_info(
67 &self,
68 driver_filter: &[String],
69 iterator: fidl::endpoints::ServerEnd<
70 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
71 >,
72 ) -> Result<(), fidl::Error>;
73 fn r#get_composite_node_specs(
74 &self,
75 name_filter: Option<&str>,
76 iterator: fidl::endpoints::ServerEnd<
77 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
78 >,
79 ) -> Result<(), fidl::Error>;
80 type DisableDriverResponseFut: std::future::Future<Output = Result<DevelopmentManagerDisableDriverResult, fidl::Error>>
81 + Send;
82 fn r#disable_driver(
83 &self,
84 driver_url: &str,
85 package_hash: Option<&str>,
86 ) -> Self::DisableDriverResponseFut;
87 type EnableDriverResponseFut: std::future::Future<Output = Result<DevelopmentManagerEnableDriverResult, fidl::Error>>
88 + Send;
89 fn r#enable_driver(
90 &self,
91 driver_url: &str,
92 package_hash: Option<&str>,
93 ) -> Self::EnableDriverResponseFut;
94 type RebindCompositesWithDriverResponseFut: std::future::Future<
95 Output = Result<DevelopmentManagerRebindCompositesWithDriverResult, fidl::Error>,
96 > + Send;
97 fn r#rebind_composites_with_driver(
98 &self,
99 driver_url: &str,
100 ) -> Self::RebindCompositesWithDriverResponseFut;
101}
102#[derive(Debug)]
103#[cfg(target_os = "fuchsia")]
104pub struct DevelopmentManagerSynchronousProxy {
105 client: fidl::client::sync::Client,
106}
107
108#[cfg(target_os = "fuchsia")]
109impl fidl::endpoints::SynchronousProxy for DevelopmentManagerSynchronousProxy {
110 type Proxy = DevelopmentManagerProxy;
111 type Protocol = DevelopmentManagerMarker;
112
113 fn from_channel(inner: fidl::Channel) -> Self {
114 Self::new(inner)
115 }
116
117 fn into_channel(self) -> fidl::Channel {
118 self.client.into_channel()
119 }
120
121 fn as_channel(&self) -> &fidl::Channel {
122 self.client.as_channel()
123 }
124}
125
126#[cfg(target_os = "fuchsia")]
127impl DevelopmentManagerSynchronousProxy {
128 pub fn new(channel: fidl::Channel) -> Self {
129 let protocol_name =
130 <DevelopmentManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
131 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
132 }
133
134 pub fn into_channel(self) -> fidl::Channel {
135 self.client.into_channel()
136 }
137
138 pub fn wait_for_event(
141 &self,
142 deadline: zx::MonotonicInstant,
143 ) -> Result<DevelopmentManagerEvent, fidl::Error> {
144 DevelopmentManagerEvent::decode(self.client.wait_for_event(deadline)?)
145 }
146
147 pub fn r#get_driver_info(
157 &self,
158 mut driver_filter: &[String],
159 mut iterator: fidl::endpoints::ServerEnd<
160 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
161 >,
162 ) -> Result<(), fidl::Error> {
163 self.client.send::<DevelopmentManagerGetDriverInfoRequest>(
164 (driver_filter, iterator),
165 0x80387b9999b4de2,
166 fidl::encoding::DynamicFlags::empty(),
167 )
168 }
169
170 pub fn r#get_composite_node_specs(
178 &self,
179 mut name_filter: Option<&str>,
180 mut iterator: fidl::endpoints::ServerEnd<
181 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
182 >,
183 ) -> Result<(), fidl::Error> {
184 self.client.send::<DevelopmentManagerGetCompositeNodeSpecsRequest>(
185 (name_filter, iterator),
186 0x6fd4c2f5e0478970,
187 fidl::encoding::DynamicFlags::empty(),
188 )
189 }
190
191 pub fn r#disable_driver(
198 &self,
199 mut driver_url: &str,
200 mut package_hash: Option<&str>,
201 ___deadline: zx::MonotonicInstant,
202 ) -> Result<DevelopmentManagerDisableDriverResult, fidl::Error> {
203 let _response = self.client.send_query::<
204 DevelopmentManagerDisableDriverRequest,
205 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
206 >(
207 (driver_url, package_hash,),
208 0x7a9043fc2acabf77,
209 fidl::encoding::DynamicFlags::empty(),
210 ___deadline,
211 )?;
212 Ok(_response.map(|x| x))
213 }
214
215 pub fn r#enable_driver(
219 &self,
220 mut driver_url: &str,
221 mut package_hash: Option<&str>,
222 ___deadline: zx::MonotonicInstant,
223 ) -> Result<DevelopmentManagerEnableDriverResult, fidl::Error> {
224 let _response = self.client.send_query::<
225 DevelopmentManagerEnableDriverRequest,
226 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
227 >(
228 (driver_url, package_hash,),
229 0x4abba8d322e671d9,
230 fidl::encoding::DynamicFlags::empty(),
231 ___deadline,
232 )?;
233 Ok(_response.map(|x| x))
234 }
235
236 pub fn r#rebind_composites_with_driver(
240 &self,
241 mut driver_url: &str,
242 ___deadline: zx::MonotonicInstant,
243 ) -> Result<DevelopmentManagerRebindCompositesWithDriverResult, fidl::Error> {
244 let _response = self.client.send_query::<
245 DevelopmentManagerRebindCompositesWithDriverRequest,
246 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
247 >(
248 (driver_url,),
249 0x1da137c4f10d053c,
250 fidl::encoding::DynamicFlags::empty(),
251 ___deadline,
252 )?;
253 Ok(_response.map(|x| x))
254 }
255}
256
257#[cfg(target_os = "fuchsia")]
258impl From<DevelopmentManagerSynchronousProxy> for zx::Handle {
259 fn from(value: DevelopmentManagerSynchronousProxy) -> Self {
260 value.into_channel().into()
261 }
262}
263
264#[cfg(target_os = "fuchsia")]
265impl From<fidl::Channel> for DevelopmentManagerSynchronousProxy {
266 fn from(value: fidl::Channel) -> Self {
267 Self::new(value)
268 }
269}
270
271#[derive(Debug, Clone)]
272pub struct DevelopmentManagerProxy {
273 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
274}
275
276impl fidl::endpoints::Proxy for DevelopmentManagerProxy {
277 type Protocol = DevelopmentManagerMarker;
278
279 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
280 Self::new(inner)
281 }
282
283 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
284 self.client.into_channel().map_err(|client| Self { client })
285 }
286
287 fn as_channel(&self) -> &::fidl::AsyncChannel {
288 self.client.as_channel()
289 }
290}
291
292impl DevelopmentManagerProxy {
293 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
295 let protocol_name =
296 <DevelopmentManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
297 Self { client: fidl::client::Client::new(channel, protocol_name) }
298 }
299
300 pub fn take_event_stream(&self) -> DevelopmentManagerEventStream {
306 DevelopmentManagerEventStream { event_receiver: self.client.take_event_receiver() }
307 }
308
309 pub fn r#get_driver_info(
319 &self,
320 mut driver_filter: &[String],
321 mut iterator: fidl::endpoints::ServerEnd<
322 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
323 >,
324 ) -> Result<(), fidl::Error> {
325 DevelopmentManagerProxyInterface::r#get_driver_info(self, driver_filter, iterator)
326 }
327
328 pub fn r#get_composite_node_specs(
336 &self,
337 mut name_filter: Option<&str>,
338 mut iterator: fidl::endpoints::ServerEnd<
339 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
340 >,
341 ) -> Result<(), fidl::Error> {
342 DevelopmentManagerProxyInterface::r#get_composite_node_specs(self, name_filter, iterator)
343 }
344
345 pub fn r#disable_driver(
352 &self,
353 mut driver_url: &str,
354 mut package_hash: Option<&str>,
355 ) -> fidl::client::QueryResponseFut<
356 DevelopmentManagerDisableDriverResult,
357 fidl::encoding::DefaultFuchsiaResourceDialect,
358 > {
359 DevelopmentManagerProxyInterface::r#disable_driver(self, driver_url, package_hash)
360 }
361
362 pub fn r#enable_driver(
366 &self,
367 mut driver_url: &str,
368 mut package_hash: Option<&str>,
369 ) -> fidl::client::QueryResponseFut<
370 DevelopmentManagerEnableDriverResult,
371 fidl::encoding::DefaultFuchsiaResourceDialect,
372 > {
373 DevelopmentManagerProxyInterface::r#enable_driver(self, driver_url, package_hash)
374 }
375
376 pub fn r#rebind_composites_with_driver(
380 &self,
381 mut driver_url: &str,
382 ) -> fidl::client::QueryResponseFut<
383 DevelopmentManagerRebindCompositesWithDriverResult,
384 fidl::encoding::DefaultFuchsiaResourceDialect,
385 > {
386 DevelopmentManagerProxyInterface::r#rebind_composites_with_driver(self, driver_url)
387 }
388}
389
390impl DevelopmentManagerProxyInterface for DevelopmentManagerProxy {
391 fn r#get_driver_info(
392 &self,
393 mut driver_filter: &[String],
394 mut iterator: fidl::endpoints::ServerEnd<
395 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
396 >,
397 ) -> Result<(), fidl::Error> {
398 self.client.send::<DevelopmentManagerGetDriverInfoRequest>(
399 (driver_filter, iterator),
400 0x80387b9999b4de2,
401 fidl::encoding::DynamicFlags::empty(),
402 )
403 }
404
405 fn r#get_composite_node_specs(
406 &self,
407 mut name_filter: Option<&str>,
408 mut iterator: fidl::endpoints::ServerEnd<
409 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
410 >,
411 ) -> Result<(), fidl::Error> {
412 self.client.send::<DevelopmentManagerGetCompositeNodeSpecsRequest>(
413 (name_filter, iterator),
414 0x6fd4c2f5e0478970,
415 fidl::encoding::DynamicFlags::empty(),
416 )
417 }
418
419 type DisableDriverResponseFut = fidl::client::QueryResponseFut<
420 DevelopmentManagerDisableDriverResult,
421 fidl::encoding::DefaultFuchsiaResourceDialect,
422 >;
423 fn r#disable_driver(
424 &self,
425 mut driver_url: &str,
426 mut package_hash: Option<&str>,
427 ) -> Self::DisableDriverResponseFut {
428 fn _decode(
429 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
430 ) -> Result<DevelopmentManagerDisableDriverResult, fidl::Error> {
431 let _response = fidl::client::decode_transaction_body::<
432 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
433 fidl::encoding::DefaultFuchsiaResourceDialect,
434 0x7a9043fc2acabf77,
435 >(_buf?)?;
436 Ok(_response.map(|x| x))
437 }
438 self.client.send_query_and_decode::<
439 DevelopmentManagerDisableDriverRequest,
440 DevelopmentManagerDisableDriverResult,
441 >(
442 (driver_url, package_hash,),
443 0x7a9043fc2acabf77,
444 fidl::encoding::DynamicFlags::empty(),
445 _decode,
446 )
447 }
448
449 type EnableDriverResponseFut = fidl::client::QueryResponseFut<
450 DevelopmentManagerEnableDriverResult,
451 fidl::encoding::DefaultFuchsiaResourceDialect,
452 >;
453 fn r#enable_driver(
454 &self,
455 mut driver_url: &str,
456 mut package_hash: Option<&str>,
457 ) -> Self::EnableDriverResponseFut {
458 fn _decode(
459 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
460 ) -> Result<DevelopmentManagerEnableDriverResult, fidl::Error> {
461 let _response = fidl::client::decode_transaction_body::<
462 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
463 fidl::encoding::DefaultFuchsiaResourceDialect,
464 0x4abba8d322e671d9,
465 >(_buf?)?;
466 Ok(_response.map(|x| x))
467 }
468 self.client.send_query_and_decode::<
469 DevelopmentManagerEnableDriverRequest,
470 DevelopmentManagerEnableDriverResult,
471 >(
472 (driver_url, package_hash,),
473 0x4abba8d322e671d9,
474 fidl::encoding::DynamicFlags::empty(),
475 _decode,
476 )
477 }
478
479 type RebindCompositesWithDriverResponseFut = fidl::client::QueryResponseFut<
480 DevelopmentManagerRebindCompositesWithDriverResult,
481 fidl::encoding::DefaultFuchsiaResourceDialect,
482 >;
483 fn r#rebind_composites_with_driver(
484 &self,
485 mut driver_url: &str,
486 ) -> Self::RebindCompositesWithDriverResponseFut {
487 fn _decode(
488 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
489 ) -> Result<DevelopmentManagerRebindCompositesWithDriverResult, fidl::Error> {
490 let _response = fidl::client::decode_transaction_body::<
491 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
492 fidl::encoding::DefaultFuchsiaResourceDialect,
493 0x1da137c4f10d053c,
494 >(_buf?)?;
495 Ok(_response.map(|x| x))
496 }
497 self.client.send_query_and_decode::<
498 DevelopmentManagerRebindCompositesWithDriverRequest,
499 DevelopmentManagerRebindCompositesWithDriverResult,
500 >(
501 (driver_url,),
502 0x1da137c4f10d053c,
503 fidl::encoding::DynamicFlags::empty(),
504 _decode,
505 )
506 }
507}
508
509pub struct DevelopmentManagerEventStream {
510 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
511}
512
513impl std::marker::Unpin for DevelopmentManagerEventStream {}
514
515impl futures::stream::FusedStream for DevelopmentManagerEventStream {
516 fn is_terminated(&self) -> bool {
517 self.event_receiver.is_terminated()
518 }
519}
520
521impl futures::Stream for DevelopmentManagerEventStream {
522 type Item = Result<DevelopmentManagerEvent, fidl::Error>;
523
524 fn poll_next(
525 mut self: std::pin::Pin<&mut Self>,
526 cx: &mut std::task::Context<'_>,
527 ) -> std::task::Poll<Option<Self::Item>> {
528 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
529 &mut self.event_receiver,
530 cx
531 )?) {
532 Some(buf) => std::task::Poll::Ready(Some(DevelopmentManagerEvent::decode(buf))),
533 None => std::task::Poll::Ready(None),
534 }
535 }
536}
537
538#[derive(Debug)]
539pub enum DevelopmentManagerEvent {}
540
541impl DevelopmentManagerEvent {
542 fn decode(
544 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
545 ) -> Result<DevelopmentManagerEvent, fidl::Error> {
546 let (bytes, _handles) = buf.split_mut();
547 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
548 debug_assert_eq!(tx_header.tx_id, 0);
549 match tx_header.ordinal {
550 _ => Err(fidl::Error::UnknownOrdinal {
551 ordinal: tx_header.ordinal,
552 protocol_name:
553 <DevelopmentManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
554 }),
555 }
556 }
557}
558
559pub struct DevelopmentManagerRequestStream {
561 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
562 is_terminated: bool,
563}
564
565impl std::marker::Unpin for DevelopmentManagerRequestStream {}
566
567impl futures::stream::FusedStream for DevelopmentManagerRequestStream {
568 fn is_terminated(&self) -> bool {
569 self.is_terminated
570 }
571}
572
573impl fidl::endpoints::RequestStream for DevelopmentManagerRequestStream {
574 type Protocol = DevelopmentManagerMarker;
575 type ControlHandle = DevelopmentManagerControlHandle;
576
577 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
578 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
579 }
580
581 fn control_handle(&self) -> Self::ControlHandle {
582 DevelopmentManagerControlHandle { inner: self.inner.clone() }
583 }
584
585 fn into_inner(
586 self,
587 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
588 {
589 (self.inner, self.is_terminated)
590 }
591
592 fn from_inner(
593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
594 is_terminated: bool,
595 ) -> Self {
596 Self { inner, is_terminated }
597 }
598}
599
600impl futures::Stream for DevelopmentManagerRequestStream {
601 type Item = Result<DevelopmentManagerRequest, fidl::Error>;
602
603 fn poll_next(
604 mut self: std::pin::Pin<&mut Self>,
605 cx: &mut std::task::Context<'_>,
606 ) -> std::task::Poll<Option<Self::Item>> {
607 let this = &mut *self;
608 if this.inner.check_shutdown(cx) {
609 this.is_terminated = true;
610 return std::task::Poll::Ready(None);
611 }
612 if this.is_terminated {
613 panic!("polled DevelopmentManagerRequestStream after completion");
614 }
615 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
616 |bytes, handles| {
617 match this.inner.channel().read_etc(cx, bytes, handles) {
618 std::task::Poll::Ready(Ok(())) => {}
619 std::task::Poll::Pending => return std::task::Poll::Pending,
620 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
621 this.is_terminated = true;
622 return std::task::Poll::Ready(None);
623 }
624 std::task::Poll::Ready(Err(e)) => {
625 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
626 e.into(),
627 ))))
628 }
629 }
630
631 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
633
634 std::task::Poll::Ready(Some(match header.ordinal {
635 0x80387b9999b4de2 => {
636 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
637 let mut req = fidl::new_empty!(DevelopmentManagerGetDriverInfoRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
638 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevelopmentManagerGetDriverInfoRequest>(&header, _body_bytes, handles, &mut req)?;
639 let control_handle = DevelopmentManagerControlHandle {
640 inner: this.inner.clone(),
641 };
642 Ok(DevelopmentManagerRequest::GetDriverInfo {driver_filter: req.driver_filter,
643iterator: req.iterator,
644
645 control_handle,
646 })
647 }
648 0x6fd4c2f5e0478970 => {
649 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
650 let mut req = fidl::new_empty!(DevelopmentManagerGetCompositeNodeSpecsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
651 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevelopmentManagerGetCompositeNodeSpecsRequest>(&header, _body_bytes, handles, &mut req)?;
652 let control_handle = DevelopmentManagerControlHandle {
653 inner: this.inner.clone(),
654 };
655 Ok(DevelopmentManagerRequest::GetCompositeNodeSpecs {name_filter: req.name_filter,
656iterator: req.iterator,
657
658 control_handle,
659 })
660 }
661 0x7a9043fc2acabf77 => {
662 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
663 let mut req = fidl::new_empty!(DevelopmentManagerDisableDriverRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
664 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevelopmentManagerDisableDriverRequest>(&header, _body_bytes, handles, &mut req)?;
665 let control_handle = DevelopmentManagerControlHandle {
666 inner: this.inner.clone(),
667 };
668 Ok(DevelopmentManagerRequest::DisableDriver {driver_url: req.driver_url,
669package_hash: req.package_hash,
670
671 responder: DevelopmentManagerDisableDriverResponder {
672 control_handle: std::mem::ManuallyDrop::new(control_handle),
673 tx_id: header.tx_id,
674 },
675 })
676 }
677 0x4abba8d322e671d9 => {
678 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
679 let mut req = fidl::new_empty!(DevelopmentManagerEnableDriverRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
680 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevelopmentManagerEnableDriverRequest>(&header, _body_bytes, handles, &mut req)?;
681 let control_handle = DevelopmentManagerControlHandle {
682 inner: this.inner.clone(),
683 };
684 Ok(DevelopmentManagerRequest::EnableDriver {driver_url: req.driver_url,
685package_hash: req.package_hash,
686
687 responder: DevelopmentManagerEnableDriverResponder {
688 control_handle: std::mem::ManuallyDrop::new(control_handle),
689 tx_id: header.tx_id,
690 },
691 })
692 }
693 0x1da137c4f10d053c => {
694 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
695 let mut req = fidl::new_empty!(DevelopmentManagerRebindCompositesWithDriverRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
696 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DevelopmentManagerRebindCompositesWithDriverRequest>(&header, _body_bytes, handles, &mut req)?;
697 let control_handle = DevelopmentManagerControlHandle {
698 inner: this.inner.clone(),
699 };
700 Ok(DevelopmentManagerRequest::RebindCompositesWithDriver {driver_url: req.driver_url,
701
702 responder: DevelopmentManagerRebindCompositesWithDriverResponder {
703 control_handle: std::mem::ManuallyDrop::new(control_handle),
704 tx_id: header.tx_id,
705 },
706 })
707 }
708 _ => Err(fidl::Error::UnknownOrdinal {
709 ordinal: header.ordinal,
710 protocol_name: <DevelopmentManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
711 }),
712 }))
713 },
714 )
715 }
716}
717
718#[derive(Debug)]
723pub enum DevelopmentManagerRequest {
724 GetDriverInfo {
734 driver_filter: Vec<String>,
735 iterator:
736 fidl::endpoints::ServerEnd<fidl_fuchsia_driver_development::DriverInfoIteratorMarker>,
737 control_handle: DevelopmentManagerControlHandle,
738 },
739 GetCompositeNodeSpecs {
747 name_filter: Option<String>,
748 iterator: fidl::endpoints::ServerEnd<
749 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
750 >,
751 control_handle: DevelopmentManagerControlHandle,
752 },
753 DisableDriver {
760 driver_url: String,
761 package_hash: Option<String>,
762 responder: DevelopmentManagerDisableDriverResponder,
763 },
764 EnableDriver {
768 driver_url: String,
769 package_hash: Option<String>,
770 responder: DevelopmentManagerEnableDriverResponder,
771 },
772 RebindCompositesWithDriver {
776 driver_url: String,
777 responder: DevelopmentManagerRebindCompositesWithDriverResponder,
778 },
779}
780
781impl DevelopmentManagerRequest {
782 #[allow(irrefutable_let_patterns)]
783 pub fn into_get_driver_info(
784 self,
785 ) -> Option<(
786 Vec<String>,
787 fidl::endpoints::ServerEnd<fidl_fuchsia_driver_development::DriverInfoIteratorMarker>,
788 DevelopmentManagerControlHandle,
789 )> {
790 if let DevelopmentManagerRequest::GetDriverInfo {
791 driver_filter,
792 iterator,
793 control_handle,
794 } = self
795 {
796 Some((driver_filter, iterator, control_handle))
797 } else {
798 None
799 }
800 }
801
802 #[allow(irrefutable_let_patterns)]
803 pub fn into_get_composite_node_specs(
804 self,
805 ) -> Option<(
806 Option<String>,
807 fidl::endpoints::ServerEnd<
808 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
809 >,
810 DevelopmentManagerControlHandle,
811 )> {
812 if let DevelopmentManagerRequest::GetCompositeNodeSpecs {
813 name_filter,
814 iterator,
815 control_handle,
816 } = self
817 {
818 Some((name_filter, iterator, control_handle))
819 } else {
820 None
821 }
822 }
823
824 #[allow(irrefutable_let_patterns)]
825 pub fn into_disable_driver(
826 self,
827 ) -> Option<(String, Option<String>, DevelopmentManagerDisableDriverResponder)> {
828 if let DevelopmentManagerRequest::DisableDriver { driver_url, package_hash, responder } =
829 self
830 {
831 Some((driver_url, package_hash, responder))
832 } else {
833 None
834 }
835 }
836
837 #[allow(irrefutable_let_patterns)]
838 pub fn into_enable_driver(
839 self,
840 ) -> Option<(String, Option<String>, DevelopmentManagerEnableDriverResponder)> {
841 if let DevelopmentManagerRequest::EnableDriver { driver_url, package_hash, responder } =
842 self
843 {
844 Some((driver_url, package_hash, responder))
845 } else {
846 None
847 }
848 }
849
850 #[allow(irrefutable_let_patterns)]
851 pub fn into_rebind_composites_with_driver(
852 self,
853 ) -> Option<(String, DevelopmentManagerRebindCompositesWithDriverResponder)> {
854 if let DevelopmentManagerRequest::RebindCompositesWithDriver { driver_url, responder } =
855 self
856 {
857 Some((driver_url, responder))
858 } else {
859 None
860 }
861 }
862
863 pub fn method_name(&self) -> &'static str {
865 match *self {
866 DevelopmentManagerRequest::GetDriverInfo { .. } => "get_driver_info",
867 DevelopmentManagerRequest::GetCompositeNodeSpecs { .. } => "get_composite_node_specs",
868 DevelopmentManagerRequest::DisableDriver { .. } => "disable_driver",
869 DevelopmentManagerRequest::EnableDriver { .. } => "enable_driver",
870 DevelopmentManagerRequest::RebindCompositesWithDriver { .. } => {
871 "rebind_composites_with_driver"
872 }
873 }
874 }
875}
876
877#[derive(Debug, Clone)]
878pub struct DevelopmentManagerControlHandle {
879 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
880}
881
882impl fidl::endpoints::ControlHandle for DevelopmentManagerControlHandle {
883 fn shutdown(&self) {
884 self.inner.shutdown()
885 }
886 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
887 self.inner.shutdown_with_epitaph(status)
888 }
889
890 fn is_closed(&self) -> bool {
891 self.inner.channel().is_closed()
892 }
893 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
894 self.inner.channel().on_closed()
895 }
896
897 #[cfg(target_os = "fuchsia")]
898 fn signal_peer(
899 &self,
900 clear_mask: zx::Signals,
901 set_mask: zx::Signals,
902 ) -> Result<(), zx_status::Status> {
903 use fidl::Peered;
904 self.inner.channel().signal_peer(clear_mask, set_mask)
905 }
906}
907
908impl DevelopmentManagerControlHandle {}
909
910#[must_use = "FIDL methods require a response to be sent"]
911#[derive(Debug)]
912pub struct DevelopmentManagerDisableDriverResponder {
913 control_handle: std::mem::ManuallyDrop<DevelopmentManagerControlHandle>,
914 tx_id: u32,
915}
916
917impl std::ops::Drop for DevelopmentManagerDisableDriverResponder {
921 fn drop(&mut self) {
922 self.control_handle.shutdown();
923 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
925 }
926}
927
928impl fidl::endpoints::Responder for DevelopmentManagerDisableDriverResponder {
929 type ControlHandle = DevelopmentManagerControlHandle;
930
931 fn control_handle(&self) -> &DevelopmentManagerControlHandle {
932 &self.control_handle
933 }
934
935 fn drop_without_shutdown(mut self) {
936 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
938 std::mem::forget(self);
940 }
941}
942
943impl DevelopmentManagerDisableDriverResponder {
944 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
948 let _result = self.send_raw(result);
949 if _result.is_err() {
950 self.control_handle.shutdown();
951 }
952 self.drop_without_shutdown();
953 _result
954 }
955
956 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
958 let _result = self.send_raw(result);
959 self.drop_without_shutdown();
960 _result
961 }
962
963 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
964 self.control_handle
965 .inner
966 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
967 result,
968 self.tx_id,
969 0x7a9043fc2acabf77,
970 fidl::encoding::DynamicFlags::empty(),
971 )
972 }
973}
974
975#[must_use = "FIDL methods require a response to be sent"]
976#[derive(Debug)]
977pub struct DevelopmentManagerEnableDriverResponder {
978 control_handle: std::mem::ManuallyDrop<DevelopmentManagerControlHandle>,
979 tx_id: u32,
980}
981
982impl std::ops::Drop for DevelopmentManagerEnableDriverResponder {
986 fn drop(&mut self) {
987 self.control_handle.shutdown();
988 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
990 }
991}
992
993impl fidl::endpoints::Responder for DevelopmentManagerEnableDriverResponder {
994 type ControlHandle = DevelopmentManagerControlHandle;
995
996 fn control_handle(&self) -> &DevelopmentManagerControlHandle {
997 &self.control_handle
998 }
999
1000 fn drop_without_shutdown(mut self) {
1001 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1003 std::mem::forget(self);
1005 }
1006}
1007
1008impl DevelopmentManagerEnableDriverResponder {
1009 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1013 let _result = self.send_raw(result);
1014 if _result.is_err() {
1015 self.control_handle.shutdown();
1016 }
1017 self.drop_without_shutdown();
1018 _result
1019 }
1020
1021 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1023 let _result = self.send_raw(result);
1024 self.drop_without_shutdown();
1025 _result
1026 }
1027
1028 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1029 self.control_handle
1030 .inner
1031 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1032 result,
1033 self.tx_id,
1034 0x4abba8d322e671d9,
1035 fidl::encoding::DynamicFlags::empty(),
1036 )
1037 }
1038}
1039
1040#[must_use = "FIDL methods require a response to be sent"]
1041#[derive(Debug)]
1042pub struct DevelopmentManagerRebindCompositesWithDriverResponder {
1043 control_handle: std::mem::ManuallyDrop<DevelopmentManagerControlHandle>,
1044 tx_id: u32,
1045}
1046
1047impl std::ops::Drop for DevelopmentManagerRebindCompositesWithDriverResponder {
1051 fn drop(&mut self) {
1052 self.control_handle.shutdown();
1053 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1055 }
1056}
1057
1058impl fidl::endpoints::Responder for DevelopmentManagerRebindCompositesWithDriverResponder {
1059 type ControlHandle = DevelopmentManagerControlHandle;
1060
1061 fn control_handle(&self) -> &DevelopmentManagerControlHandle {
1062 &self.control_handle
1063 }
1064
1065 fn drop_without_shutdown(mut self) {
1066 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1068 std::mem::forget(self);
1070 }
1071}
1072
1073impl DevelopmentManagerRebindCompositesWithDriverResponder {
1074 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1078 let _result = self.send_raw(result);
1079 if _result.is_err() {
1080 self.control_handle.shutdown();
1081 }
1082 self.drop_without_shutdown();
1083 _result
1084 }
1085
1086 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1088 let _result = self.send_raw(result);
1089 self.drop_without_shutdown();
1090 _result
1091 }
1092
1093 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1094 self.control_handle
1095 .inner
1096 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1097 result,
1098 self.tx_id,
1099 0x1da137c4f10d053c,
1100 fidl::encoding::DynamicFlags::empty(),
1101 )
1102 }
1103}
1104
1105#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1106pub struct DriverIndexMarker;
1107
1108impl fidl::endpoints::ProtocolMarker for DriverIndexMarker {
1109 type Proxy = DriverIndexProxy;
1110 type RequestStream = DriverIndexRequestStream;
1111 #[cfg(target_os = "fuchsia")]
1112 type SynchronousProxy = DriverIndexSynchronousProxy;
1113
1114 const DEBUG_NAME: &'static str = "fuchsia.driver.index.DriverIndex";
1115}
1116impl fidl::endpoints::DiscoverableProtocolMarker for DriverIndexMarker {}
1117pub type DriverIndexMatchDriverResult = Result<MatchDriverResult, i32>;
1118pub type DriverIndexAddCompositeNodeSpecResult = Result<(), i32>;
1119pub type DriverIndexRebindCompositeNodeSpecResult = Result<(), i32>;
1120
1121pub trait DriverIndexProxyInterface: Send + Sync {
1122 type MatchDriverResponseFut: std::future::Future<Output = Result<DriverIndexMatchDriverResult, fidl::Error>>
1123 + Send;
1124 fn r#match_driver(&self, args: &MatchDriverArgs) -> Self::MatchDriverResponseFut;
1125 type AddCompositeNodeSpecResponseFut: std::future::Future<Output = Result<DriverIndexAddCompositeNodeSpecResult, fidl::Error>>
1126 + Send;
1127 fn r#add_composite_node_spec(
1128 &self,
1129 payload: &fidl_fuchsia_driver_framework::CompositeNodeSpec,
1130 ) -> Self::AddCompositeNodeSpecResponseFut;
1131 type RebindCompositeNodeSpecResponseFut: std::future::Future<Output = Result<DriverIndexRebindCompositeNodeSpecResult, fidl::Error>>
1132 + Send;
1133 fn r#rebind_composite_node_spec(
1134 &self,
1135 spec: &str,
1136 driver_url_suffix: Option<&str>,
1137 ) -> Self::RebindCompositeNodeSpecResponseFut;
1138 fn r#set_notifier(
1139 &self,
1140 notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
1141 ) -> Result<(), fidl::Error>;
1142}
1143#[derive(Debug)]
1144#[cfg(target_os = "fuchsia")]
1145pub struct DriverIndexSynchronousProxy {
1146 client: fidl::client::sync::Client,
1147}
1148
1149#[cfg(target_os = "fuchsia")]
1150impl fidl::endpoints::SynchronousProxy for DriverIndexSynchronousProxy {
1151 type Proxy = DriverIndexProxy;
1152 type Protocol = DriverIndexMarker;
1153
1154 fn from_channel(inner: fidl::Channel) -> Self {
1155 Self::new(inner)
1156 }
1157
1158 fn into_channel(self) -> fidl::Channel {
1159 self.client.into_channel()
1160 }
1161
1162 fn as_channel(&self) -> &fidl::Channel {
1163 self.client.as_channel()
1164 }
1165}
1166
1167#[cfg(target_os = "fuchsia")]
1168impl DriverIndexSynchronousProxy {
1169 pub fn new(channel: fidl::Channel) -> Self {
1170 let protocol_name = <DriverIndexMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1171 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1172 }
1173
1174 pub fn into_channel(self) -> fidl::Channel {
1175 self.client.into_channel()
1176 }
1177
1178 pub fn wait_for_event(
1181 &self,
1182 deadline: zx::MonotonicInstant,
1183 ) -> Result<DriverIndexEvent, fidl::Error> {
1184 DriverIndexEvent::decode(self.client.wait_for_event(deadline)?)
1185 }
1186
1187 pub fn r#match_driver(
1189 &self,
1190 mut args: &MatchDriverArgs,
1191 ___deadline: zx::MonotonicInstant,
1192 ) -> Result<DriverIndexMatchDriverResult, fidl::Error> {
1193 let _response = self.client.send_query::<
1194 DriverIndexMatchDriverRequest,
1195 fidl::encoding::ResultType<MatchDriverResult, i32>,
1196 >(
1197 (args,),
1198 0x38317894f6269541,
1199 fidl::encoding::DynamicFlags::empty(),
1200 ___deadline,
1201 )?;
1202 Ok(_response.map(|x| x))
1203 }
1204
1205 pub fn r#add_composite_node_spec(
1209 &self,
1210 mut payload: &fidl_fuchsia_driver_framework::CompositeNodeSpec,
1211 ___deadline: zx::MonotonicInstant,
1212 ) -> Result<DriverIndexAddCompositeNodeSpecResult, fidl::Error> {
1213 let _response = self.client.send_query::<
1214 fidl_fuchsia_driver_framework::CompositeNodeSpec,
1215 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1216 >(
1217 payload,
1218 0x66d25a18fa46a2a2,
1219 fidl::encoding::DynamicFlags::empty(),
1220 ___deadline,
1221 )?;
1222 Ok(_response.map(|x| x))
1223 }
1224
1225 pub fn r#rebind_composite_node_spec(
1229 &self,
1230 mut spec: &str,
1231 mut driver_url_suffix: Option<&str>,
1232 ___deadline: zx::MonotonicInstant,
1233 ) -> Result<DriverIndexRebindCompositeNodeSpecResult, fidl::Error> {
1234 let _response = self.client.send_query::<
1235 DriverIndexRebindCompositeNodeSpecRequest,
1236 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1237 >(
1238 (spec, driver_url_suffix,),
1239 0x6667ac8de58b202a,
1240 fidl::encoding::DynamicFlags::empty(),
1241 ___deadline,
1242 )?;
1243 Ok(_response.map(|x| x))
1244 }
1245
1246 pub fn r#set_notifier(
1248 &self,
1249 mut notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
1250 ) -> Result<(), fidl::Error> {
1251 self.client.send::<DriverIndexSetNotifierRequest>(
1252 (notifier,),
1253 0x1dfdede9fcdab511,
1254 fidl::encoding::DynamicFlags::empty(),
1255 )
1256 }
1257}
1258
1259#[cfg(target_os = "fuchsia")]
1260impl From<DriverIndexSynchronousProxy> for zx::Handle {
1261 fn from(value: DriverIndexSynchronousProxy) -> Self {
1262 value.into_channel().into()
1263 }
1264}
1265
1266#[cfg(target_os = "fuchsia")]
1267impl From<fidl::Channel> for DriverIndexSynchronousProxy {
1268 fn from(value: fidl::Channel) -> Self {
1269 Self::new(value)
1270 }
1271}
1272
1273#[derive(Debug, Clone)]
1274pub struct DriverIndexProxy {
1275 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1276}
1277
1278impl fidl::endpoints::Proxy for DriverIndexProxy {
1279 type Protocol = DriverIndexMarker;
1280
1281 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1282 Self::new(inner)
1283 }
1284
1285 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1286 self.client.into_channel().map_err(|client| Self { client })
1287 }
1288
1289 fn as_channel(&self) -> &::fidl::AsyncChannel {
1290 self.client.as_channel()
1291 }
1292}
1293
1294impl DriverIndexProxy {
1295 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1297 let protocol_name = <DriverIndexMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1298 Self { client: fidl::client::Client::new(channel, protocol_name) }
1299 }
1300
1301 pub fn take_event_stream(&self) -> DriverIndexEventStream {
1307 DriverIndexEventStream { event_receiver: self.client.take_event_receiver() }
1308 }
1309
1310 pub fn r#match_driver(
1312 &self,
1313 mut args: &MatchDriverArgs,
1314 ) -> fidl::client::QueryResponseFut<
1315 DriverIndexMatchDriverResult,
1316 fidl::encoding::DefaultFuchsiaResourceDialect,
1317 > {
1318 DriverIndexProxyInterface::r#match_driver(self, args)
1319 }
1320
1321 pub fn r#add_composite_node_spec(
1325 &self,
1326 mut payload: &fidl_fuchsia_driver_framework::CompositeNodeSpec,
1327 ) -> fidl::client::QueryResponseFut<
1328 DriverIndexAddCompositeNodeSpecResult,
1329 fidl::encoding::DefaultFuchsiaResourceDialect,
1330 > {
1331 DriverIndexProxyInterface::r#add_composite_node_spec(self, payload)
1332 }
1333
1334 pub fn r#rebind_composite_node_spec(
1338 &self,
1339 mut spec: &str,
1340 mut driver_url_suffix: Option<&str>,
1341 ) -> fidl::client::QueryResponseFut<
1342 DriverIndexRebindCompositeNodeSpecResult,
1343 fidl::encoding::DefaultFuchsiaResourceDialect,
1344 > {
1345 DriverIndexProxyInterface::r#rebind_composite_node_spec(self, spec, driver_url_suffix)
1346 }
1347
1348 pub fn r#set_notifier(
1350 &self,
1351 mut notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
1352 ) -> Result<(), fidl::Error> {
1353 DriverIndexProxyInterface::r#set_notifier(self, notifier)
1354 }
1355}
1356
1357impl DriverIndexProxyInterface for DriverIndexProxy {
1358 type MatchDriverResponseFut = fidl::client::QueryResponseFut<
1359 DriverIndexMatchDriverResult,
1360 fidl::encoding::DefaultFuchsiaResourceDialect,
1361 >;
1362 fn r#match_driver(&self, mut args: &MatchDriverArgs) -> Self::MatchDriverResponseFut {
1363 fn _decode(
1364 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1365 ) -> Result<DriverIndexMatchDriverResult, fidl::Error> {
1366 let _response = fidl::client::decode_transaction_body::<
1367 fidl::encoding::ResultType<MatchDriverResult, i32>,
1368 fidl::encoding::DefaultFuchsiaResourceDialect,
1369 0x38317894f6269541,
1370 >(_buf?)?;
1371 Ok(_response.map(|x| x))
1372 }
1373 self.client
1374 .send_query_and_decode::<DriverIndexMatchDriverRequest, DriverIndexMatchDriverResult>(
1375 (args,),
1376 0x38317894f6269541,
1377 fidl::encoding::DynamicFlags::empty(),
1378 _decode,
1379 )
1380 }
1381
1382 type AddCompositeNodeSpecResponseFut = fidl::client::QueryResponseFut<
1383 DriverIndexAddCompositeNodeSpecResult,
1384 fidl::encoding::DefaultFuchsiaResourceDialect,
1385 >;
1386 fn r#add_composite_node_spec(
1387 &self,
1388 mut payload: &fidl_fuchsia_driver_framework::CompositeNodeSpec,
1389 ) -> Self::AddCompositeNodeSpecResponseFut {
1390 fn _decode(
1391 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1392 ) -> Result<DriverIndexAddCompositeNodeSpecResult, fidl::Error> {
1393 let _response = fidl::client::decode_transaction_body::<
1394 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1395 fidl::encoding::DefaultFuchsiaResourceDialect,
1396 0x66d25a18fa46a2a2,
1397 >(_buf?)?;
1398 Ok(_response.map(|x| x))
1399 }
1400 self.client.send_query_and_decode::<
1401 fidl_fuchsia_driver_framework::CompositeNodeSpec,
1402 DriverIndexAddCompositeNodeSpecResult,
1403 >(
1404 payload,
1405 0x66d25a18fa46a2a2,
1406 fidl::encoding::DynamicFlags::empty(),
1407 _decode,
1408 )
1409 }
1410
1411 type RebindCompositeNodeSpecResponseFut = fidl::client::QueryResponseFut<
1412 DriverIndexRebindCompositeNodeSpecResult,
1413 fidl::encoding::DefaultFuchsiaResourceDialect,
1414 >;
1415 fn r#rebind_composite_node_spec(
1416 &self,
1417 mut spec: &str,
1418 mut driver_url_suffix: Option<&str>,
1419 ) -> Self::RebindCompositeNodeSpecResponseFut {
1420 fn _decode(
1421 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1422 ) -> Result<DriverIndexRebindCompositeNodeSpecResult, fidl::Error> {
1423 let _response = fidl::client::decode_transaction_body::<
1424 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1425 fidl::encoding::DefaultFuchsiaResourceDialect,
1426 0x6667ac8de58b202a,
1427 >(_buf?)?;
1428 Ok(_response.map(|x| x))
1429 }
1430 self.client.send_query_and_decode::<
1431 DriverIndexRebindCompositeNodeSpecRequest,
1432 DriverIndexRebindCompositeNodeSpecResult,
1433 >(
1434 (spec, driver_url_suffix,),
1435 0x6667ac8de58b202a,
1436 fidl::encoding::DynamicFlags::empty(),
1437 _decode,
1438 )
1439 }
1440
1441 fn r#set_notifier(
1442 &self,
1443 mut notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
1444 ) -> Result<(), fidl::Error> {
1445 self.client.send::<DriverIndexSetNotifierRequest>(
1446 (notifier,),
1447 0x1dfdede9fcdab511,
1448 fidl::encoding::DynamicFlags::empty(),
1449 )
1450 }
1451}
1452
1453pub struct DriverIndexEventStream {
1454 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1455}
1456
1457impl std::marker::Unpin for DriverIndexEventStream {}
1458
1459impl futures::stream::FusedStream for DriverIndexEventStream {
1460 fn is_terminated(&self) -> bool {
1461 self.event_receiver.is_terminated()
1462 }
1463}
1464
1465impl futures::Stream for DriverIndexEventStream {
1466 type Item = Result<DriverIndexEvent, fidl::Error>;
1467
1468 fn poll_next(
1469 mut self: std::pin::Pin<&mut Self>,
1470 cx: &mut std::task::Context<'_>,
1471 ) -> std::task::Poll<Option<Self::Item>> {
1472 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1473 &mut self.event_receiver,
1474 cx
1475 )?) {
1476 Some(buf) => std::task::Poll::Ready(Some(DriverIndexEvent::decode(buf))),
1477 None => std::task::Poll::Ready(None),
1478 }
1479 }
1480}
1481
1482#[derive(Debug)]
1483pub enum DriverIndexEvent {}
1484
1485impl DriverIndexEvent {
1486 fn decode(
1488 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1489 ) -> Result<DriverIndexEvent, fidl::Error> {
1490 let (bytes, _handles) = buf.split_mut();
1491 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1492 debug_assert_eq!(tx_header.tx_id, 0);
1493 match tx_header.ordinal {
1494 _ => Err(fidl::Error::UnknownOrdinal {
1495 ordinal: tx_header.ordinal,
1496 protocol_name: <DriverIndexMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1497 }),
1498 }
1499 }
1500}
1501
1502pub struct DriverIndexRequestStream {
1504 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1505 is_terminated: bool,
1506}
1507
1508impl std::marker::Unpin for DriverIndexRequestStream {}
1509
1510impl futures::stream::FusedStream for DriverIndexRequestStream {
1511 fn is_terminated(&self) -> bool {
1512 self.is_terminated
1513 }
1514}
1515
1516impl fidl::endpoints::RequestStream for DriverIndexRequestStream {
1517 type Protocol = DriverIndexMarker;
1518 type ControlHandle = DriverIndexControlHandle;
1519
1520 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1521 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1522 }
1523
1524 fn control_handle(&self) -> Self::ControlHandle {
1525 DriverIndexControlHandle { inner: self.inner.clone() }
1526 }
1527
1528 fn into_inner(
1529 self,
1530 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1531 {
1532 (self.inner, self.is_terminated)
1533 }
1534
1535 fn from_inner(
1536 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1537 is_terminated: bool,
1538 ) -> Self {
1539 Self { inner, is_terminated }
1540 }
1541}
1542
1543impl futures::Stream for DriverIndexRequestStream {
1544 type Item = Result<DriverIndexRequest, fidl::Error>;
1545
1546 fn poll_next(
1547 mut self: std::pin::Pin<&mut Self>,
1548 cx: &mut std::task::Context<'_>,
1549 ) -> std::task::Poll<Option<Self::Item>> {
1550 let this = &mut *self;
1551 if this.inner.check_shutdown(cx) {
1552 this.is_terminated = true;
1553 return std::task::Poll::Ready(None);
1554 }
1555 if this.is_terminated {
1556 panic!("polled DriverIndexRequestStream after completion");
1557 }
1558 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1559 |bytes, handles| {
1560 match this.inner.channel().read_etc(cx, bytes, handles) {
1561 std::task::Poll::Ready(Ok(())) => {}
1562 std::task::Poll::Pending => return std::task::Poll::Pending,
1563 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1564 this.is_terminated = true;
1565 return std::task::Poll::Ready(None);
1566 }
1567 std::task::Poll::Ready(Err(e)) => {
1568 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1569 e.into(),
1570 ))))
1571 }
1572 }
1573
1574 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1576
1577 std::task::Poll::Ready(Some(match header.ordinal {
1578 0x38317894f6269541 => {
1579 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1580 let mut req = fidl::new_empty!(
1581 DriverIndexMatchDriverRequest,
1582 fidl::encoding::DefaultFuchsiaResourceDialect
1583 );
1584 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DriverIndexMatchDriverRequest>(&header, _body_bytes, handles, &mut req)?;
1585 let control_handle = DriverIndexControlHandle { inner: this.inner.clone() };
1586 Ok(DriverIndexRequest::MatchDriver {
1587 args: req.args,
1588
1589 responder: DriverIndexMatchDriverResponder {
1590 control_handle: std::mem::ManuallyDrop::new(control_handle),
1591 tx_id: header.tx_id,
1592 },
1593 })
1594 }
1595 0x66d25a18fa46a2a2 => {
1596 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1597 let mut req = fidl::new_empty!(
1598 fidl_fuchsia_driver_framework::CompositeNodeSpec,
1599 fidl::encoding::DefaultFuchsiaResourceDialect
1600 );
1601 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_driver_framework::CompositeNodeSpec>(&header, _body_bytes, handles, &mut req)?;
1602 let control_handle = DriverIndexControlHandle { inner: this.inner.clone() };
1603 Ok(DriverIndexRequest::AddCompositeNodeSpec {
1604 payload: req,
1605 responder: DriverIndexAddCompositeNodeSpecResponder {
1606 control_handle: std::mem::ManuallyDrop::new(control_handle),
1607 tx_id: header.tx_id,
1608 },
1609 })
1610 }
1611 0x6667ac8de58b202a => {
1612 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1613 let mut req = fidl::new_empty!(
1614 DriverIndexRebindCompositeNodeSpecRequest,
1615 fidl::encoding::DefaultFuchsiaResourceDialect
1616 );
1617 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DriverIndexRebindCompositeNodeSpecRequest>(&header, _body_bytes, handles, &mut req)?;
1618 let control_handle = DriverIndexControlHandle { inner: this.inner.clone() };
1619 Ok(DriverIndexRequest::RebindCompositeNodeSpec {
1620 spec: req.spec,
1621 driver_url_suffix: req.driver_url_suffix,
1622
1623 responder: DriverIndexRebindCompositeNodeSpecResponder {
1624 control_handle: std::mem::ManuallyDrop::new(control_handle),
1625 tx_id: header.tx_id,
1626 },
1627 })
1628 }
1629 0x1dfdede9fcdab511 => {
1630 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1631 let mut req = fidl::new_empty!(
1632 DriverIndexSetNotifierRequest,
1633 fidl::encoding::DefaultFuchsiaResourceDialect
1634 );
1635 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DriverIndexSetNotifierRequest>(&header, _body_bytes, handles, &mut req)?;
1636 let control_handle = DriverIndexControlHandle { inner: this.inner.clone() };
1637 Ok(DriverIndexRequest::SetNotifier {
1638 notifier: req.notifier,
1639
1640 control_handle,
1641 })
1642 }
1643 _ => Err(fidl::Error::UnknownOrdinal {
1644 ordinal: header.ordinal,
1645 protocol_name:
1646 <DriverIndexMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1647 }),
1648 }))
1649 },
1650 )
1651 }
1652}
1653
1654#[derive(Debug)]
1656pub enum DriverIndexRequest {
1657 MatchDriver { args: MatchDriverArgs, responder: DriverIndexMatchDriverResponder },
1659 AddCompositeNodeSpec {
1663 payload: fidl_fuchsia_driver_framework::CompositeNodeSpec,
1664 responder: DriverIndexAddCompositeNodeSpecResponder,
1665 },
1666 RebindCompositeNodeSpec {
1670 spec: String,
1671 driver_url_suffix: Option<String>,
1672 responder: DriverIndexRebindCompositeNodeSpecResponder,
1673 },
1674 SetNotifier {
1676 notifier: fidl::endpoints::ClientEnd<DriverNotifierMarker>,
1677 control_handle: DriverIndexControlHandle,
1678 },
1679}
1680
1681impl DriverIndexRequest {
1682 #[allow(irrefutable_let_patterns)]
1683 pub fn into_match_driver(self) -> Option<(MatchDriverArgs, DriverIndexMatchDriverResponder)> {
1684 if let DriverIndexRequest::MatchDriver { args, responder } = self {
1685 Some((args, responder))
1686 } else {
1687 None
1688 }
1689 }
1690
1691 #[allow(irrefutable_let_patterns)]
1692 pub fn into_add_composite_node_spec(
1693 self,
1694 ) -> Option<(
1695 fidl_fuchsia_driver_framework::CompositeNodeSpec,
1696 DriverIndexAddCompositeNodeSpecResponder,
1697 )> {
1698 if let DriverIndexRequest::AddCompositeNodeSpec { payload, responder } = self {
1699 Some((payload, responder))
1700 } else {
1701 None
1702 }
1703 }
1704
1705 #[allow(irrefutable_let_patterns)]
1706 pub fn into_rebind_composite_node_spec(
1707 self,
1708 ) -> Option<(String, Option<String>, DriverIndexRebindCompositeNodeSpecResponder)> {
1709 if let DriverIndexRequest::RebindCompositeNodeSpec { spec, driver_url_suffix, responder } =
1710 self
1711 {
1712 Some((spec, driver_url_suffix, responder))
1713 } else {
1714 None
1715 }
1716 }
1717
1718 #[allow(irrefutable_let_patterns)]
1719 pub fn into_set_notifier(
1720 self,
1721 ) -> Option<(fidl::endpoints::ClientEnd<DriverNotifierMarker>, DriverIndexControlHandle)> {
1722 if let DriverIndexRequest::SetNotifier { notifier, control_handle } = self {
1723 Some((notifier, control_handle))
1724 } else {
1725 None
1726 }
1727 }
1728
1729 pub fn method_name(&self) -> &'static str {
1731 match *self {
1732 DriverIndexRequest::MatchDriver { .. } => "match_driver",
1733 DriverIndexRequest::AddCompositeNodeSpec { .. } => "add_composite_node_spec",
1734 DriverIndexRequest::RebindCompositeNodeSpec { .. } => "rebind_composite_node_spec",
1735 DriverIndexRequest::SetNotifier { .. } => "set_notifier",
1736 }
1737 }
1738}
1739
1740#[derive(Debug, Clone)]
1741pub struct DriverIndexControlHandle {
1742 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1743}
1744
1745impl fidl::endpoints::ControlHandle for DriverIndexControlHandle {
1746 fn shutdown(&self) {
1747 self.inner.shutdown()
1748 }
1749 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1750 self.inner.shutdown_with_epitaph(status)
1751 }
1752
1753 fn is_closed(&self) -> bool {
1754 self.inner.channel().is_closed()
1755 }
1756 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1757 self.inner.channel().on_closed()
1758 }
1759
1760 #[cfg(target_os = "fuchsia")]
1761 fn signal_peer(
1762 &self,
1763 clear_mask: zx::Signals,
1764 set_mask: zx::Signals,
1765 ) -> Result<(), zx_status::Status> {
1766 use fidl::Peered;
1767 self.inner.channel().signal_peer(clear_mask, set_mask)
1768 }
1769}
1770
1771impl DriverIndexControlHandle {}
1772
1773#[must_use = "FIDL methods require a response to be sent"]
1774#[derive(Debug)]
1775pub struct DriverIndexMatchDriverResponder {
1776 control_handle: std::mem::ManuallyDrop<DriverIndexControlHandle>,
1777 tx_id: u32,
1778}
1779
1780impl std::ops::Drop for DriverIndexMatchDriverResponder {
1784 fn drop(&mut self) {
1785 self.control_handle.shutdown();
1786 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1788 }
1789}
1790
1791impl fidl::endpoints::Responder for DriverIndexMatchDriverResponder {
1792 type ControlHandle = DriverIndexControlHandle;
1793
1794 fn control_handle(&self) -> &DriverIndexControlHandle {
1795 &self.control_handle
1796 }
1797
1798 fn drop_without_shutdown(mut self) {
1799 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1801 std::mem::forget(self);
1803 }
1804}
1805
1806impl DriverIndexMatchDriverResponder {
1807 pub fn send(self, mut result: Result<&MatchDriverResult, i32>) -> Result<(), fidl::Error> {
1811 let _result = self.send_raw(result);
1812 if _result.is_err() {
1813 self.control_handle.shutdown();
1814 }
1815 self.drop_without_shutdown();
1816 _result
1817 }
1818
1819 pub fn send_no_shutdown_on_err(
1821 self,
1822 mut result: Result<&MatchDriverResult, i32>,
1823 ) -> Result<(), fidl::Error> {
1824 let _result = self.send_raw(result);
1825 self.drop_without_shutdown();
1826 _result
1827 }
1828
1829 fn send_raw(&self, mut result: Result<&MatchDriverResult, i32>) -> Result<(), fidl::Error> {
1830 self.control_handle.inner.send::<fidl::encoding::ResultType<MatchDriverResult, i32>>(
1831 result,
1832 self.tx_id,
1833 0x38317894f6269541,
1834 fidl::encoding::DynamicFlags::empty(),
1835 )
1836 }
1837}
1838
1839#[must_use = "FIDL methods require a response to be sent"]
1840#[derive(Debug)]
1841pub struct DriverIndexAddCompositeNodeSpecResponder {
1842 control_handle: std::mem::ManuallyDrop<DriverIndexControlHandle>,
1843 tx_id: u32,
1844}
1845
1846impl std::ops::Drop for DriverIndexAddCompositeNodeSpecResponder {
1850 fn drop(&mut self) {
1851 self.control_handle.shutdown();
1852 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1854 }
1855}
1856
1857impl fidl::endpoints::Responder for DriverIndexAddCompositeNodeSpecResponder {
1858 type ControlHandle = DriverIndexControlHandle;
1859
1860 fn control_handle(&self) -> &DriverIndexControlHandle {
1861 &self.control_handle
1862 }
1863
1864 fn drop_without_shutdown(mut self) {
1865 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1867 std::mem::forget(self);
1869 }
1870}
1871
1872impl DriverIndexAddCompositeNodeSpecResponder {
1873 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1877 let _result = self.send_raw(result);
1878 if _result.is_err() {
1879 self.control_handle.shutdown();
1880 }
1881 self.drop_without_shutdown();
1882 _result
1883 }
1884
1885 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1887 let _result = self.send_raw(result);
1888 self.drop_without_shutdown();
1889 _result
1890 }
1891
1892 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1893 self.control_handle
1894 .inner
1895 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1896 result,
1897 self.tx_id,
1898 0x66d25a18fa46a2a2,
1899 fidl::encoding::DynamicFlags::empty(),
1900 )
1901 }
1902}
1903
1904#[must_use = "FIDL methods require a response to be sent"]
1905#[derive(Debug)]
1906pub struct DriverIndexRebindCompositeNodeSpecResponder {
1907 control_handle: std::mem::ManuallyDrop<DriverIndexControlHandle>,
1908 tx_id: u32,
1909}
1910
1911impl std::ops::Drop for DriverIndexRebindCompositeNodeSpecResponder {
1915 fn drop(&mut self) {
1916 self.control_handle.shutdown();
1917 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1919 }
1920}
1921
1922impl fidl::endpoints::Responder for DriverIndexRebindCompositeNodeSpecResponder {
1923 type ControlHandle = DriverIndexControlHandle;
1924
1925 fn control_handle(&self) -> &DriverIndexControlHandle {
1926 &self.control_handle
1927 }
1928
1929 fn drop_without_shutdown(mut self) {
1930 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1932 std::mem::forget(self);
1934 }
1935}
1936
1937impl DriverIndexRebindCompositeNodeSpecResponder {
1938 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1942 let _result = self.send_raw(result);
1943 if _result.is_err() {
1944 self.control_handle.shutdown();
1945 }
1946 self.drop_without_shutdown();
1947 _result
1948 }
1949
1950 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1952 let _result = self.send_raw(result);
1953 self.drop_without_shutdown();
1954 _result
1955 }
1956
1957 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1958 self.control_handle
1959 .inner
1960 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1961 result,
1962 self.tx_id,
1963 0x6667ac8de58b202a,
1964 fidl::encoding::DynamicFlags::empty(),
1965 )
1966 }
1967}
1968
1969#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1970pub struct DriverNotifierMarker;
1971
1972impl fidl::endpoints::ProtocolMarker for DriverNotifierMarker {
1973 type Proxy = DriverNotifierProxy;
1974 type RequestStream = DriverNotifierRequestStream;
1975 #[cfg(target_os = "fuchsia")]
1976 type SynchronousProxy = DriverNotifierSynchronousProxy;
1977
1978 const DEBUG_NAME: &'static str = "(anonymous) DriverNotifier";
1979}
1980
1981pub trait DriverNotifierProxyInterface: Send + Sync {
1982 fn r#new_driver_available(&self) -> Result<(), fidl::Error>;
1983}
1984#[derive(Debug)]
1985#[cfg(target_os = "fuchsia")]
1986pub struct DriverNotifierSynchronousProxy {
1987 client: fidl::client::sync::Client,
1988}
1989
1990#[cfg(target_os = "fuchsia")]
1991impl fidl::endpoints::SynchronousProxy for DriverNotifierSynchronousProxy {
1992 type Proxy = DriverNotifierProxy;
1993 type Protocol = DriverNotifierMarker;
1994
1995 fn from_channel(inner: fidl::Channel) -> Self {
1996 Self::new(inner)
1997 }
1998
1999 fn into_channel(self) -> fidl::Channel {
2000 self.client.into_channel()
2001 }
2002
2003 fn as_channel(&self) -> &fidl::Channel {
2004 self.client.as_channel()
2005 }
2006}
2007
2008#[cfg(target_os = "fuchsia")]
2009impl DriverNotifierSynchronousProxy {
2010 pub fn new(channel: fidl::Channel) -> Self {
2011 let protocol_name = <DriverNotifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2012 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2013 }
2014
2015 pub fn into_channel(self) -> fidl::Channel {
2016 self.client.into_channel()
2017 }
2018
2019 pub fn wait_for_event(
2022 &self,
2023 deadline: zx::MonotonicInstant,
2024 ) -> Result<DriverNotifierEvent, fidl::Error> {
2025 DriverNotifierEvent::decode(self.client.wait_for_event(deadline)?)
2026 }
2027
2028 pub fn r#new_driver_available(&self) -> Result<(), fidl::Error> {
2031 self.client.send::<fidl::encoding::EmptyPayload>(
2032 (),
2033 0x1642ffd065b6b48e,
2034 fidl::encoding::DynamicFlags::empty(),
2035 )
2036 }
2037}
2038
2039#[cfg(target_os = "fuchsia")]
2040impl From<DriverNotifierSynchronousProxy> for zx::Handle {
2041 fn from(value: DriverNotifierSynchronousProxy) -> Self {
2042 value.into_channel().into()
2043 }
2044}
2045
2046#[cfg(target_os = "fuchsia")]
2047impl From<fidl::Channel> for DriverNotifierSynchronousProxy {
2048 fn from(value: fidl::Channel) -> Self {
2049 Self::new(value)
2050 }
2051}
2052
2053#[derive(Debug, Clone)]
2054pub struct DriverNotifierProxy {
2055 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2056}
2057
2058impl fidl::endpoints::Proxy for DriverNotifierProxy {
2059 type Protocol = DriverNotifierMarker;
2060
2061 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2062 Self::new(inner)
2063 }
2064
2065 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2066 self.client.into_channel().map_err(|client| Self { client })
2067 }
2068
2069 fn as_channel(&self) -> &::fidl::AsyncChannel {
2070 self.client.as_channel()
2071 }
2072}
2073
2074impl DriverNotifierProxy {
2075 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2077 let protocol_name = <DriverNotifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2078 Self { client: fidl::client::Client::new(channel, protocol_name) }
2079 }
2080
2081 pub fn take_event_stream(&self) -> DriverNotifierEventStream {
2087 DriverNotifierEventStream { event_receiver: self.client.take_event_receiver() }
2088 }
2089
2090 pub fn r#new_driver_available(&self) -> Result<(), fidl::Error> {
2093 DriverNotifierProxyInterface::r#new_driver_available(self)
2094 }
2095}
2096
2097impl DriverNotifierProxyInterface for DriverNotifierProxy {
2098 fn r#new_driver_available(&self) -> Result<(), fidl::Error> {
2099 self.client.send::<fidl::encoding::EmptyPayload>(
2100 (),
2101 0x1642ffd065b6b48e,
2102 fidl::encoding::DynamicFlags::empty(),
2103 )
2104 }
2105}
2106
2107pub struct DriverNotifierEventStream {
2108 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2109}
2110
2111impl std::marker::Unpin for DriverNotifierEventStream {}
2112
2113impl futures::stream::FusedStream for DriverNotifierEventStream {
2114 fn is_terminated(&self) -> bool {
2115 self.event_receiver.is_terminated()
2116 }
2117}
2118
2119impl futures::Stream for DriverNotifierEventStream {
2120 type Item = Result<DriverNotifierEvent, fidl::Error>;
2121
2122 fn poll_next(
2123 mut self: std::pin::Pin<&mut Self>,
2124 cx: &mut std::task::Context<'_>,
2125 ) -> std::task::Poll<Option<Self::Item>> {
2126 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2127 &mut self.event_receiver,
2128 cx
2129 )?) {
2130 Some(buf) => std::task::Poll::Ready(Some(DriverNotifierEvent::decode(buf))),
2131 None => std::task::Poll::Ready(None),
2132 }
2133 }
2134}
2135
2136#[derive(Debug)]
2137pub enum DriverNotifierEvent {}
2138
2139impl DriverNotifierEvent {
2140 fn decode(
2142 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2143 ) -> Result<DriverNotifierEvent, fidl::Error> {
2144 let (bytes, _handles) = buf.split_mut();
2145 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2146 debug_assert_eq!(tx_header.tx_id, 0);
2147 match tx_header.ordinal {
2148 _ => Err(fidl::Error::UnknownOrdinal {
2149 ordinal: tx_header.ordinal,
2150 protocol_name:
2151 <DriverNotifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2152 }),
2153 }
2154 }
2155}
2156
2157pub struct DriverNotifierRequestStream {
2159 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2160 is_terminated: bool,
2161}
2162
2163impl std::marker::Unpin for DriverNotifierRequestStream {}
2164
2165impl futures::stream::FusedStream for DriverNotifierRequestStream {
2166 fn is_terminated(&self) -> bool {
2167 self.is_terminated
2168 }
2169}
2170
2171impl fidl::endpoints::RequestStream for DriverNotifierRequestStream {
2172 type Protocol = DriverNotifierMarker;
2173 type ControlHandle = DriverNotifierControlHandle;
2174
2175 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2176 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2177 }
2178
2179 fn control_handle(&self) -> Self::ControlHandle {
2180 DriverNotifierControlHandle { inner: self.inner.clone() }
2181 }
2182
2183 fn into_inner(
2184 self,
2185 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2186 {
2187 (self.inner, self.is_terminated)
2188 }
2189
2190 fn from_inner(
2191 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2192 is_terminated: bool,
2193 ) -> Self {
2194 Self { inner, is_terminated }
2195 }
2196}
2197
2198impl futures::Stream for DriverNotifierRequestStream {
2199 type Item = Result<DriverNotifierRequest, fidl::Error>;
2200
2201 fn poll_next(
2202 mut self: std::pin::Pin<&mut Self>,
2203 cx: &mut std::task::Context<'_>,
2204 ) -> std::task::Poll<Option<Self::Item>> {
2205 let this = &mut *self;
2206 if this.inner.check_shutdown(cx) {
2207 this.is_terminated = true;
2208 return std::task::Poll::Ready(None);
2209 }
2210 if this.is_terminated {
2211 panic!("polled DriverNotifierRequestStream after completion");
2212 }
2213 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2214 |bytes, handles| {
2215 match this.inner.channel().read_etc(cx, bytes, handles) {
2216 std::task::Poll::Ready(Ok(())) => {}
2217 std::task::Poll::Pending => return std::task::Poll::Pending,
2218 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2219 this.is_terminated = true;
2220 return std::task::Poll::Ready(None);
2221 }
2222 std::task::Poll::Ready(Err(e)) => {
2223 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2224 e.into(),
2225 ))))
2226 }
2227 }
2228
2229 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2231
2232 std::task::Poll::Ready(Some(match header.ordinal {
2233 0x1642ffd065b6b48e => {
2234 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2235 let mut req = fidl::new_empty!(
2236 fidl::encoding::EmptyPayload,
2237 fidl::encoding::DefaultFuchsiaResourceDialect
2238 );
2239 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2240 let control_handle =
2241 DriverNotifierControlHandle { inner: this.inner.clone() };
2242 Ok(DriverNotifierRequest::NewDriverAvailable { control_handle })
2243 }
2244 _ => Err(fidl::Error::UnknownOrdinal {
2245 ordinal: header.ordinal,
2246 protocol_name:
2247 <DriverNotifierMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2248 }),
2249 }))
2250 },
2251 )
2252 }
2253}
2254
2255#[derive(Debug)]
2262pub enum DriverNotifierRequest {
2263 NewDriverAvailable { control_handle: DriverNotifierControlHandle },
2266}
2267
2268impl DriverNotifierRequest {
2269 #[allow(irrefutable_let_patterns)]
2270 pub fn into_new_driver_available(self) -> Option<(DriverNotifierControlHandle)> {
2271 if let DriverNotifierRequest::NewDriverAvailable { control_handle } = self {
2272 Some((control_handle))
2273 } else {
2274 None
2275 }
2276 }
2277
2278 pub fn method_name(&self) -> &'static str {
2280 match *self {
2281 DriverNotifierRequest::NewDriverAvailable { .. } => "new_driver_available",
2282 }
2283 }
2284}
2285
2286#[derive(Debug, Clone)]
2287pub struct DriverNotifierControlHandle {
2288 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2289}
2290
2291impl fidl::endpoints::ControlHandle for DriverNotifierControlHandle {
2292 fn shutdown(&self) {
2293 self.inner.shutdown()
2294 }
2295 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2296 self.inner.shutdown_with_epitaph(status)
2297 }
2298
2299 fn is_closed(&self) -> bool {
2300 self.inner.channel().is_closed()
2301 }
2302 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2303 self.inner.channel().on_closed()
2304 }
2305
2306 #[cfg(target_os = "fuchsia")]
2307 fn signal_peer(
2308 &self,
2309 clear_mask: zx::Signals,
2310 set_mask: zx::Signals,
2311 ) -> Result<(), zx_status::Status> {
2312 use fidl::Peered;
2313 self.inner.channel().signal_peer(clear_mask, set_mask)
2314 }
2315}
2316
2317impl DriverNotifierControlHandle {}
2318
2319mod internal {
2320 use super::*;
2321
2322 impl fidl::encoding::ResourceTypeMarker for DevelopmentManagerGetCompositeNodeSpecsRequest {
2323 type Borrowed<'a> = &'a mut Self;
2324 fn take_or_borrow<'a>(
2325 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2326 ) -> Self::Borrowed<'a> {
2327 value
2328 }
2329 }
2330
2331 unsafe impl fidl::encoding::TypeMarker for DevelopmentManagerGetCompositeNodeSpecsRequest {
2332 type Owned = Self;
2333
2334 #[inline(always)]
2335 fn inline_align(_context: fidl::encoding::Context) -> usize {
2336 8
2337 }
2338
2339 #[inline(always)]
2340 fn inline_size(_context: fidl::encoding::Context) -> usize {
2341 24
2342 }
2343 }
2344
2345 unsafe impl
2346 fidl::encoding::Encode<
2347 DevelopmentManagerGetCompositeNodeSpecsRequest,
2348 fidl::encoding::DefaultFuchsiaResourceDialect,
2349 > for &mut DevelopmentManagerGetCompositeNodeSpecsRequest
2350 {
2351 #[inline]
2352 unsafe fn encode(
2353 self,
2354 encoder: &mut fidl::encoding::Encoder<
2355 '_,
2356 fidl::encoding::DefaultFuchsiaResourceDialect,
2357 >,
2358 offset: usize,
2359 _depth: fidl::encoding::Depth,
2360 ) -> fidl::Result<()> {
2361 encoder.debug_check_bounds::<DevelopmentManagerGetCompositeNodeSpecsRequest>(offset);
2362 fidl::encoding::Encode::<DevelopmentManagerGetCompositeNodeSpecsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2364 (
2365 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name_filter),
2366 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
2367 ),
2368 encoder, offset, _depth
2369 )
2370 }
2371 }
2372 unsafe impl<
2373 T0: fidl::encoding::Encode<
2374 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2375 fidl::encoding::DefaultFuchsiaResourceDialect,
2376 >,
2377 T1: fidl::encoding::Encode<
2378 fidl::encoding::Endpoint<
2379 fidl::endpoints::ServerEnd<
2380 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
2381 >,
2382 >,
2383 fidl::encoding::DefaultFuchsiaResourceDialect,
2384 >,
2385 >
2386 fidl::encoding::Encode<
2387 DevelopmentManagerGetCompositeNodeSpecsRequest,
2388 fidl::encoding::DefaultFuchsiaResourceDialect,
2389 > for (T0, T1)
2390 {
2391 #[inline]
2392 unsafe fn encode(
2393 self,
2394 encoder: &mut fidl::encoding::Encoder<
2395 '_,
2396 fidl::encoding::DefaultFuchsiaResourceDialect,
2397 >,
2398 offset: usize,
2399 depth: fidl::encoding::Depth,
2400 ) -> fidl::Result<()> {
2401 encoder.debug_check_bounds::<DevelopmentManagerGetCompositeNodeSpecsRequest>(offset);
2402 unsafe {
2405 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2406 (ptr as *mut u64).write_unaligned(0);
2407 }
2408 self.0.encode(encoder, offset + 0, depth)?;
2410 self.1.encode(encoder, offset + 16, depth)?;
2411 Ok(())
2412 }
2413 }
2414
2415 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2416 for DevelopmentManagerGetCompositeNodeSpecsRequest
2417 {
2418 #[inline(always)]
2419 fn new_empty() -> Self {
2420 Self {
2421 name_filter: fidl::new_empty!(
2422 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2423 fidl::encoding::DefaultFuchsiaResourceDialect
2424 ),
2425 iterator: fidl::new_empty!(
2426 fidl::encoding::Endpoint<
2427 fidl::endpoints::ServerEnd<
2428 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
2429 >,
2430 >,
2431 fidl::encoding::DefaultFuchsiaResourceDialect
2432 ),
2433 }
2434 }
2435
2436 #[inline]
2437 unsafe fn decode(
2438 &mut self,
2439 decoder: &mut fidl::encoding::Decoder<
2440 '_,
2441 fidl::encoding::DefaultFuchsiaResourceDialect,
2442 >,
2443 offset: usize,
2444 _depth: fidl::encoding::Depth,
2445 ) -> fidl::Result<()> {
2446 decoder.debug_check_bounds::<Self>(offset);
2447 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2449 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2450 let mask = 0xffffffff00000000u64;
2451 let maskedval = padval & mask;
2452 if maskedval != 0 {
2453 return Err(fidl::Error::NonZeroPadding {
2454 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2455 });
2456 }
2457 fidl::decode!(
2458 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2459 fidl::encoding::DefaultFuchsiaResourceDialect,
2460 &mut self.name_filter,
2461 decoder,
2462 offset + 0,
2463 _depth
2464 )?;
2465 fidl::decode!(
2466 fidl::encoding::Endpoint<
2467 fidl::endpoints::ServerEnd<
2468 fidl_fuchsia_driver_development::CompositeNodeSpecIteratorMarker,
2469 >,
2470 >,
2471 fidl::encoding::DefaultFuchsiaResourceDialect,
2472 &mut self.iterator,
2473 decoder,
2474 offset + 16,
2475 _depth
2476 )?;
2477 Ok(())
2478 }
2479 }
2480
2481 impl fidl::encoding::ResourceTypeMarker for DevelopmentManagerGetDriverInfoRequest {
2482 type Borrowed<'a> = &'a mut Self;
2483 fn take_or_borrow<'a>(
2484 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2485 ) -> Self::Borrowed<'a> {
2486 value
2487 }
2488 }
2489
2490 unsafe impl fidl::encoding::TypeMarker for DevelopmentManagerGetDriverInfoRequest {
2491 type Owned = Self;
2492
2493 #[inline(always)]
2494 fn inline_align(_context: fidl::encoding::Context) -> usize {
2495 8
2496 }
2497
2498 #[inline(always)]
2499 fn inline_size(_context: fidl::encoding::Context) -> usize {
2500 24
2501 }
2502 }
2503
2504 unsafe impl
2505 fidl::encoding::Encode<
2506 DevelopmentManagerGetDriverInfoRequest,
2507 fidl::encoding::DefaultFuchsiaResourceDialect,
2508 > for &mut DevelopmentManagerGetDriverInfoRequest
2509 {
2510 #[inline]
2511 unsafe fn encode(
2512 self,
2513 encoder: &mut fidl::encoding::Encoder<
2514 '_,
2515 fidl::encoding::DefaultFuchsiaResourceDialect,
2516 >,
2517 offset: usize,
2518 _depth: fidl::encoding::Depth,
2519 ) -> fidl::Result<()> {
2520 encoder.debug_check_bounds::<DevelopmentManagerGetDriverInfoRequest>(offset);
2521 fidl::encoding::Encode::<DevelopmentManagerGetDriverInfoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2523 (
2524 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_filter),
2525 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_driver_development::DriverInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
2526 ),
2527 encoder, offset, _depth
2528 )
2529 }
2530 }
2531 unsafe impl<
2532 T0: fidl::encoding::Encode<
2533 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2534 fidl::encoding::DefaultFuchsiaResourceDialect,
2535 >,
2536 T1: fidl::encoding::Encode<
2537 fidl::encoding::Endpoint<
2538 fidl::endpoints::ServerEnd<
2539 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
2540 >,
2541 >,
2542 fidl::encoding::DefaultFuchsiaResourceDialect,
2543 >,
2544 >
2545 fidl::encoding::Encode<
2546 DevelopmentManagerGetDriverInfoRequest,
2547 fidl::encoding::DefaultFuchsiaResourceDialect,
2548 > for (T0, T1)
2549 {
2550 #[inline]
2551 unsafe fn encode(
2552 self,
2553 encoder: &mut fidl::encoding::Encoder<
2554 '_,
2555 fidl::encoding::DefaultFuchsiaResourceDialect,
2556 >,
2557 offset: usize,
2558 depth: fidl::encoding::Depth,
2559 ) -> fidl::Result<()> {
2560 encoder.debug_check_bounds::<DevelopmentManagerGetDriverInfoRequest>(offset);
2561 unsafe {
2564 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2565 (ptr as *mut u64).write_unaligned(0);
2566 }
2567 self.0.encode(encoder, offset + 0, depth)?;
2569 self.1.encode(encoder, offset + 16, depth)?;
2570 Ok(())
2571 }
2572 }
2573
2574 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2575 for DevelopmentManagerGetDriverInfoRequest
2576 {
2577 #[inline(always)]
2578 fn new_empty() -> Self {
2579 Self {
2580 driver_filter: fidl::new_empty!(
2581 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2582 fidl::encoding::DefaultFuchsiaResourceDialect
2583 ),
2584 iterator: fidl::new_empty!(
2585 fidl::encoding::Endpoint<
2586 fidl::endpoints::ServerEnd<
2587 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
2588 >,
2589 >,
2590 fidl::encoding::DefaultFuchsiaResourceDialect
2591 ),
2592 }
2593 }
2594
2595 #[inline]
2596 unsafe fn decode(
2597 &mut self,
2598 decoder: &mut fidl::encoding::Decoder<
2599 '_,
2600 fidl::encoding::DefaultFuchsiaResourceDialect,
2601 >,
2602 offset: usize,
2603 _depth: fidl::encoding::Depth,
2604 ) -> fidl::Result<()> {
2605 decoder.debug_check_bounds::<Self>(offset);
2606 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2608 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2609 let mask = 0xffffffff00000000u64;
2610 let maskedval = padval & mask;
2611 if maskedval != 0 {
2612 return Err(fidl::Error::NonZeroPadding {
2613 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2614 });
2615 }
2616 fidl::decode!(
2617 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2618 fidl::encoding::DefaultFuchsiaResourceDialect,
2619 &mut self.driver_filter,
2620 decoder,
2621 offset + 0,
2622 _depth
2623 )?;
2624 fidl::decode!(
2625 fidl::encoding::Endpoint<
2626 fidl::endpoints::ServerEnd<
2627 fidl_fuchsia_driver_development::DriverInfoIteratorMarker,
2628 >,
2629 >,
2630 fidl::encoding::DefaultFuchsiaResourceDialect,
2631 &mut self.iterator,
2632 decoder,
2633 offset + 16,
2634 _depth
2635 )?;
2636 Ok(())
2637 }
2638 }
2639
2640 impl fidl::encoding::ResourceTypeMarker for DriverIndexSetNotifierRequest {
2641 type Borrowed<'a> = &'a mut Self;
2642 fn take_or_borrow<'a>(
2643 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2644 ) -> Self::Borrowed<'a> {
2645 value
2646 }
2647 }
2648
2649 unsafe impl fidl::encoding::TypeMarker for DriverIndexSetNotifierRequest {
2650 type Owned = Self;
2651
2652 #[inline(always)]
2653 fn inline_align(_context: fidl::encoding::Context) -> usize {
2654 4
2655 }
2656
2657 #[inline(always)]
2658 fn inline_size(_context: fidl::encoding::Context) -> usize {
2659 4
2660 }
2661 }
2662
2663 unsafe impl
2664 fidl::encoding::Encode<
2665 DriverIndexSetNotifierRequest,
2666 fidl::encoding::DefaultFuchsiaResourceDialect,
2667 > for &mut DriverIndexSetNotifierRequest
2668 {
2669 #[inline]
2670 unsafe fn encode(
2671 self,
2672 encoder: &mut fidl::encoding::Encoder<
2673 '_,
2674 fidl::encoding::DefaultFuchsiaResourceDialect,
2675 >,
2676 offset: usize,
2677 _depth: fidl::encoding::Depth,
2678 ) -> fidl::Result<()> {
2679 encoder.debug_check_bounds::<DriverIndexSetNotifierRequest>(offset);
2680 fidl::encoding::Encode::<DriverIndexSetNotifierRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2682 (
2683 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DriverNotifierMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.notifier),
2684 ),
2685 encoder, offset, _depth
2686 )
2687 }
2688 }
2689 unsafe impl<
2690 T0: fidl::encoding::Encode<
2691 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DriverNotifierMarker>>,
2692 fidl::encoding::DefaultFuchsiaResourceDialect,
2693 >,
2694 >
2695 fidl::encoding::Encode<
2696 DriverIndexSetNotifierRequest,
2697 fidl::encoding::DefaultFuchsiaResourceDialect,
2698 > for (T0,)
2699 {
2700 #[inline]
2701 unsafe fn encode(
2702 self,
2703 encoder: &mut fidl::encoding::Encoder<
2704 '_,
2705 fidl::encoding::DefaultFuchsiaResourceDialect,
2706 >,
2707 offset: usize,
2708 depth: fidl::encoding::Depth,
2709 ) -> fidl::Result<()> {
2710 encoder.debug_check_bounds::<DriverIndexSetNotifierRequest>(offset);
2711 self.0.encode(encoder, offset + 0, depth)?;
2715 Ok(())
2716 }
2717 }
2718
2719 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2720 for DriverIndexSetNotifierRequest
2721 {
2722 #[inline(always)]
2723 fn new_empty() -> Self {
2724 Self {
2725 notifier: fidl::new_empty!(
2726 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DriverNotifierMarker>>,
2727 fidl::encoding::DefaultFuchsiaResourceDialect
2728 ),
2729 }
2730 }
2731
2732 #[inline]
2733 unsafe fn decode(
2734 &mut self,
2735 decoder: &mut fidl::encoding::Decoder<
2736 '_,
2737 fidl::encoding::DefaultFuchsiaResourceDialect,
2738 >,
2739 offset: usize,
2740 _depth: fidl::encoding::Depth,
2741 ) -> fidl::Result<()> {
2742 decoder.debug_check_bounds::<Self>(offset);
2743 fidl::decode!(
2745 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DriverNotifierMarker>>,
2746 fidl::encoding::DefaultFuchsiaResourceDialect,
2747 &mut self.notifier,
2748 decoder,
2749 offset + 0,
2750 _depth
2751 )?;
2752 Ok(())
2753 }
2754 }
2755}