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_test_wlan_testcontroller_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct TestControllerCreateFullmacRequest {
16 pub bridge_client:
17 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for TestControllerCreateFullmacRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26#[repr(C)]
27pub struct TestControllerDeleteFullmacRequest {
28 pub id: u32,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for TestControllerDeleteFullmacRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37#[repr(C)]
38pub struct TestControllerCreateFullmacResponse {
39 pub id: u32,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for TestControllerCreateFullmacResponse
44{
45}
46
47#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
48pub struct TestControllerMarker;
49
50impl fidl::endpoints::ProtocolMarker for TestControllerMarker {
51 type Proxy = TestControllerProxy;
52 type RequestStream = TestControllerRequestStream;
53 #[cfg(target_os = "fuchsia")]
54 type SynchronousProxy = TestControllerSynchronousProxy;
55
56 const DEBUG_NAME: &'static str = "(anonymous) TestController";
57}
58pub type TestControllerCreateFullmacResult = Result<u32, i32>;
59pub type TestControllerDeleteFullmacResult = Result<(), i32>;
60
61pub trait TestControllerProxyInterface: Send + Sync {
62 type CreateFullmacResponseFut: std::future::Future<Output = Result<TestControllerCreateFullmacResult, fidl::Error>>
63 + Send;
64 fn r#create_fullmac(
65 &self,
66 bridge_client: fidl::endpoints::ClientEnd<
67 fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker,
68 >,
69 ) -> Self::CreateFullmacResponseFut;
70 type DeleteFullmacResponseFut: std::future::Future<Output = Result<TestControllerDeleteFullmacResult, fidl::Error>>
71 + Send;
72 fn r#delete_fullmac(&self, id: u32) -> Self::DeleteFullmacResponseFut;
73}
74#[derive(Debug)]
75#[cfg(target_os = "fuchsia")]
76pub struct TestControllerSynchronousProxy {
77 client: fidl::client::sync::Client,
78}
79
80#[cfg(target_os = "fuchsia")]
81impl fidl::endpoints::SynchronousProxy for TestControllerSynchronousProxy {
82 type Proxy = TestControllerProxy;
83 type Protocol = TestControllerMarker;
84
85 fn from_channel(inner: fidl::Channel) -> Self {
86 Self::new(inner)
87 }
88
89 fn into_channel(self) -> fidl::Channel {
90 self.client.into_channel()
91 }
92
93 fn as_channel(&self) -> &fidl::Channel {
94 self.client.as_channel()
95 }
96}
97
98#[cfg(target_os = "fuchsia")]
99impl TestControllerSynchronousProxy {
100 pub fn new(channel: fidl::Channel) -> Self {
101 let protocol_name = <TestControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
102 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
103 }
104
105 pub fn into_channel(self) -> fidl::Channel {
106 self.client.into_channel()
107 }
108
109 pub fn wait_for_event(
112 &self,
113 deadline: zx::MonotonicInstant,
114 ) -> Result<TestControllerEvent, fidl::Error> {
115 TestControllerEvent::decode(self.client.wait_for_event(deadline)?)
116 }
117
118 pub fn r#create_fullmac(
128 &self,
129 mut bridge_client: fidl::endpoints::ClientEnd<
130 fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker,
131 >,
132 ___deadline: zx::MonotonicInstant,
133 ) -> Result<TestControllerCreateFullmacResult, fidl::Error> {
134 let _response = self.client.send_query::<
135 TestControllerCreateFullmacRequest,
136 fidl::encoding::ResultType<TestControllerCreateFullmacResponse, i32>,
137 >(
138 (bridge_client,),
139 0x1eaf55234a2c969d,
140 fidl::encoding::DynamicFlags::empty(),
141 ___deadline,
142 )?;
143 Ok(_response.map(|x| x.id))
144 }
145
146 pub fn r#delete_fullmac(
148 &self,
149 mut id: u32,
150 ___deadline: zx::MonotonicInstant,
151 ) -> Result<TestControllerDeleteFullmacResult, fidl::Error> {
152 let _response = self.client.send_query::<
153 TestControllerDeleteFullmacRequest,
154 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
155 >(
156 (id,),
157 0x153bf68847795c91,
158 fidl::encoding::DynamicFlags::empty(),
159 ___deadline,
160 )?;
161 Ok(_response.map(|x| x))
162 }
163}
164
165#[cfg(target_os = "fuchsia")]
166impl From<TestControllerSynchronousProxy> for zx::Handle {
167 fn from(value: TestControllerSynchronousProxy) -> Self {
168 value.into_channel().into()
169 }
170}
171
172#[cfg(target_os = "fuchsia")]
173impl From<fidl::Channel> for TestControllerSynchronousProxy {
174 fn from(value: fidl::Channel) -> Self {
175 Self::new(value)
176 }
177}
178
179#[derive(Debug, Clone)]
180pub struct TestControllerProxy {
181 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
182}
183
184impl fidl::endpoints::Proxy for TestControllerProxy {
185 type Protocol = TestControllerMarker;
186
187 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
188 Self::new(inner)
189 }
190
191 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
192 self.client.into_channel().map_err(|client| Self { client })
193 }
194
195 fn as_channel(&self) -> &::fidl::AsyncChannel {
196 self.client.as_channel()
197 }
198}
199
200impl TestControllerProxy {
201 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
203 let protocol_name = <TestControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
204 Self { client: fidl::client::Client::new(channel, protocol_name) }
205 }
206
207 pub fn take_event_stream(&self) -> TestControllerEventStream {
213 TestControllerEventStream { event_receiver: self.client.take_event_receiver() }
214 }
215
216 pub fn r#create_fullmac(
226 &self,
227 mut bridge_client: fidl::endpoints::ClientEnd<
228 fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker,
229 >,
230 ) -> fidl::client::QueryResponseFut<
231 TestControllerCreateFullmacResult,
232 fidl::encoding::DefaultFuchsiaResourceDialect,
233 > {
234 TestControllerProxyInterface::r#create_fullmac(self, bridge_client)
235 }
236
237 pub fn r#delete_fullmac(
239 &self,
240 mut id: u32,
241 ) -> fidl::client::QueryResponseFut<
242 TestControllerDeleteFullmacResult,
243 fidl::encoding::DefaultFuchsiaResourceDialect,
244 > {
245 TestControllerProxyInterface::r#delete_fullmac(self, id)
246 }
247}
248
249impl TestControllerProxyInterface for TestControllerProxy {
250 type CreateFullmacResponseFut = fidl::client::QueryResponseFut<
251 TestControllerCreateFullmacResult,
252 fidl::encoding::DefaultFuchsiaResourceDialect,
253 >;
254 fn r#create_fullmac(
255 &self,
256 mut bridge_client: fidl::endpoints::ClientEnd<
257 fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker,
258 >,
259 ) -> Self::CreateFullmacResponseFut {
260 fn _decode(
261 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
262 ) -> Result<TestControllerCreateFullmacResult, fidl::Error> {
263 let _response = fidl::client::decode_transaction_body::<
264 fidl::encoding::ResultType<TestControllerCreateFullmacResponse, i32>,
265 fidl::encoding::DefaultFuchsiaResourceDialect,
266 0x1eaf55234a2c969d,
267 >(_buf?)?;
268 Ok(_response.map(|x| x.id))
269 }
270 self.client.send_query_and_decode::<
271 TestControllerCreateFullmacRequest,
272 TestControllerCreateFullmacResult,
273 >(
274 (bridge_client,),
275 0x1eaf55234a2c969d,
276 fidl::encoding::DynamicFlags::empty(),
277 _decode,
278 )
279 }
280
281 type DeleteFullmacResponseFut = fidl::client::QueryResponseFut<
282 TestControllerDeleteFullmacResult,
283 fidl::encoding::DefaultFuchsiaResourceDialect,
284 >;
285 fn r#delete_fullmac(&self, mut id: u32) -> Self::DeleteFullmacResponseFut {
286 fn _decode(
287 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
288 ) -> Result<TestControllerDeleteFullmacResult, fidl::Error> {
289 let _response = fidl::client::decode_transaction_body::<
290 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
291 fidl::encoding::DefaultFuchsiaResourceDialect,
292 0x153bf68847795c91,
293 >(_buf?)?;
294 Ok(_response.map(|x| x))
295 }
296 self.client.send_query_and_decode::<
297 TestControllerDeleteFullmacRequest,
298 TestControllerDeleteFullmacResult,
299 >(
300 (id,),
301 0x153bf68847795c91,
302 fidl::encoding::DynamicFlags::empty(),
303 _decode,
304 )
305 }
306}
307
308pub struct TestControllerEventStream {
309 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
310}
311
312impl std::marker::Unpin for TestControllerEventStream {}
313
314impl futures::stream::FusedStream for TestControllerEventStream {
315 fn is_terminated(&self) -> bool {
316 self.event_receiver.is_terminated()
317 }
318}
319
320impl futures::Stream for TestControllerEventStream {
321 type Item = Result<TestControllerEvent, fidl::Error>;
322
323 fn poll_next(
324 mut self: std::pin::Pin<&mut Self>,
325 cx: &mut std::task::Context<'_>,
326 ) -> std::task::Poll<Option<Self::Item>> {
327 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
328 &mut self.event_receiver,
329 cx
330 )?) {
331 Some(buf) => std::task::Poll::Ready(Some(TestControllerEvent::decode(buf))),
332 None => std::task::Poll::Ready(None),
333 }
334 }
335}
336
337#[derive(Debug)]
338pub enum TestControllerEvent {}
339
340impl TestControllerEvent {
341 fn decode(
343 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
344 ) -> Result<TestControllerEvent, fidl::Error> {
345 let (bytes, _handles) = buf.split_mut();
346 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
347 debug_assert_eq!(tx_header.tx_id, 0);
348 match tx_header.ordinal {
349 _ => Err(fidl::Error::UnknownOrdinal {
350 ordinal: tx_header.ordinal,
351 protocol_name:
352 <TestControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
353 }),
354 }
355 }
356}
357
358pub struct TestControllerRequestStream {
360 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
361 is_terminated: bool,
362}
363
364impl std::marker::Unpin for TestControllerRequestStream {}
365
366impl futures::stream::FusedStream for TestControllerRequestStream {
367 fn is_terminated(&self) -> bool {
368 self.is_terminated
369 }
370}
371
372impl fidl::endpoints::RequestStream for TestControllerRequestStream {
373 type Protocol = TestControllerMarker;
374 type ControlHandle = TestControllerControlHandle;
375
376 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
377 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
378 }
379
380 fn control_handle(&self) -> Self::ControlHandle {
381 TestControllerControlHandle { inner: self.inner.clone() }
382 }
383
384 fn into_inner(
385 self,
386 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
387 {
388 (self.inner, self.is_terminated)
389 }
390
391 fn from_inner(
392 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
393 is_terminated: bool,
394 ) -> Self {
395 Self { inner, is_terminated }
396 }
397}
398
399impl futures::Stream for TestControllerRequestStream {
400 type Item = Result<TestControllerRequest, fidl::Error>;
401
402 fn poll_next(
403 mut self: std::pin::Pin<&mut Self>,
404 cx: &mut std::task::Context<'_>,
405 ) -> std::task::Poll<Option<Self::Item>> {
406 let this = &mut *self;
407 if this.inner.check_shutdown(cx) {
408 this.is_terminated = true;
409 return std::task::Poll::Ready(None);
410 }
411 if this.is_terminated {
412 panic!("polled TestControllerRequestStream after completion");
413 }
414 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
415 |bytes, handles| {
416 match this.inner.channel().read_etc(cx, bytes, handles) {
417 std::task::Poll::Ready(Ok(())) => {}
418 std::task::Poll::Pending => return std::task::Poll::Pending,
419 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
420 this.is_terminated = true;
421 return std::task::Poll::Ready(None);
422 }
423 std::task::Poll::Ready(Err(e)) => {
424 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
425 e.into(),
426 ))))
427 }
428 }
429
430 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
432
433 std::task::Poll::Ready(Some(match header.ordinal {
434 0x1eaf55234a2c969d => {
435 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
436 let mut req = fidl::new_empty!(
437 TestControllerCreateFullmacRequest,
438 fidl::encoding::DefaultFuchsiaResourceDialect
439 );
440 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestControllerCreateFullmacRequest>(&header, _body_bytes, handles, &mut req)?;
441 let control_handle =
442 TestControllerControlHandle { inner: this.inner.clone() };
443 Ok(TestControllerRequest::CreateFullmac {
444 bridge_client: req.bridge_client,
445
446 responder: TestControllerCreateFullmacResponder {
447 control_handle: std::mem::ManuallyDrop::new(control_handle),
448 tx_id: header.tx_id,
449 },
450 })
451 }
452 0x153bf68847795c91 => {
453 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
454 let mut req = fidl::new_empty!(
455 TestControllerDeleteFullmacRequest,
456 fidl::encoding::DefaultFuchsiaResourceDialect
457 );
458 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestControllerDeleteFullmacRequest>(&header, _body_bytes, handles, &mut req)?;
459 let control_handle =
460 TestControllerControlHandle { inner: this.inner.clone() };
461 Ok(TestControllerRequest::DeleteFullmac {
462 id: req.id,
463
464 responder: TestControllerDeleteFullmacResponder {
465 control_handle: std::mem::ManuallyDrop::new(control_handle),
466 tx_id: header.tx_id,
467 },
468 })
469 }
470 _ => Err(fidl::Error::UnknownOrdinal {
471 ordinal: header.ordinal,
472 protocol_name:
473 <TestControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
474 }),
475 }))
476 },
477 )
478 }
479}
480
481#[derive(Debug)]
482pub enum TestControllerRequest {
483 CreateFullmac {
493 bridge_client:
494 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
495 responder: TestControllerCreateFullmacResponder,
496 },
497 DeleteFullmac { id: u32, responder: TestControllerDeleteFullmacResponder },
499}
500
501impl TestControllerRequest {
502 #[allow(irrefutable_let_patterns)]
503 pub fn into_create_fullmac(
504 self,
505 ) -> Option<(
506 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
507 TestControllerCreateFullmacResponder,
508 )> {
509 if let TestControllerRequest::CreateFullmac { bridge_client, responder } = self {
510 Some((bridge_client, responder))
511 } else {
512 None
513 }
514 }
515
516 #[allow(irrefutable_let_patterns)]
517 pub fn into_delete_fullmac(self) -> Option<(u32, TestControllerDeleteFullmacResponder)> {
518 if let TestControllerRequest::DeleteFullmac { id, responder } = self {
519 Some((id, responder))
520 } else {
521 None
522 }
523 }
524
525 pub fn method_name(&self) -> &'static str {
527 match *self {
528 TestControllerRequest::CreateFullmac { .. } => "create_fullmac",
529 TestControllerRequest::DeleteFullmac { .. } => "delete_fullmac",
530 }
531 }
532}
533
534#[derive(Debug, Clone)]
535pub struct TestControllerControlHandle {
536 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
537}
538
539impl fidl::endpoints::ControlHandle for TestControllerControlHandle {
540 fn shutdown(&self) {
541 self.inner.shutdown()
542 }
543 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
544 self.inner.shutdown_with_epitaph(status)
545 }
546
547 fn is_closed(&self) -> bool {
548 self.inner.channel().is_closed()
549 }
550 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
551 self.inner.channel().on_closed()
552 }
553
554 #[cfg(target_os = "fuchsia")]
555 fn signal_peer(
556 &self,
557 clear_mask: zx::Signals,
558 set_mask: zx::Signals,
559 ) -> Result<(), zx_status::Status> {
560 use fidl::Peered;
561 self.inner.channel().signal_peer(clear_mask, set_mask)
562 }
563}
564
565impl TestControllerControlHandle {}
566
567#[must_use = "FIDL methods require a response to be sent"]
568#[derive(Debug)]
569pub struct TestControllerCreateFullmacResponder {
570 control_handle: std::mem::ManuallyDrop<TestControllerControlHandle>,
571 tx_id: u32,
572}
573
574impl std::ops::Drop for TestControllerCreateFullmacResponder {
578 fn drop(&mut self) {
579 self.control_handle.shutdown();
580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
582 }
583}
584
585impl fidl::endpoints::Responder for TestControllerCreateFullmacResponder {
586 type ControlHandle = TestControllerControlHandle;
587
588 fn control_handle(&self) -> &TestControllerControlHandle {
589 &self.control_handle
590 }
591
592 fn drop_without_shutdown(mut self) {
593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
595 std::mem::forget(self);
597 }
598}
599
600impl TestControllerCreateFullmacResponder {
601 pub fn send(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
605 let _result = self.send_raw(result);
606 if _result.is_err() {
607 self.control_handle.shutdown();
608 }
609 self.drop_without_shutdown();
610 _result
611 }
612
613 pub fn send_no_shutdown_on_err(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
615 let _result = self.send_raw(result);
616 self.drop_without_shutdown();
617 _result
618 }
619
620 fn send_raw(&self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
621 self.control_handle.inner.send::<fidl::encoding::ResultType<
622 TestControllerCreateFullmacResponse,
623 i32,
624 >>(
625 result.map(|id| (id,)),
626 self.tx_id,
627 0x1eaf55234a2c969d,
628 fidl::encoding::DynamicFlags::empty(),
629 )
630 }
631}
632
633#[must_use = "FIDL methods require a response to be sent"]
634#[derive(Debug)]
635pub struct TestControllerDeleteFullmacResponder {
636 control_handle: std::mem::ManuallyDrop<TestControllerControlHandle>,
637 tx_id: u32,
638}
639
640impl std::ops::Drop for TestControllerDeleteFullmacResponder {
644 fn drop(&mut self) {
645 self.control_handle.shutdown();
646 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
648 }
649}
650
651impl fidl::endpoints::Responder for TestControllerDeleteFullmacResponder {
652 type ControlHandle = TestControllerControlHandle;
653
654 fn control_handle(&self) -> &TestControllerControlHandle {
655 &self.control_handle
656 }
657
658 fn drop_without_shutdown(mut self) {
659 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
661 std::mem::forget(self);
663 }
664}
665
666impl TestControllerDeleteFullmacResponder {
667 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
671 let _result = self.send_raw(result);
672 if _result.is_err() {
673 self.control_handle.shutdown();
674 }
675 self.drop_without_shutdown();
676 _result
677 }
678
679 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
681 let _result = self.send_raw(result);
682 self.drop_without_shutdown();
683 _result
684 }
685
686 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
687 self.control_handle
688 .inner
689 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
690 result,
691 self.tx_id,
692 0x153bf68847795c91,
693 fidl::encoding::DynamicFlags::empty(),
694 )
695 }
696}
697
698mod internal {
699 use super::*;
700
701 impl fidl::encoding::ResourceTypeMarker for TestControllerCreateFullmacRequest {
702 type Borrowed<'a> = &'a mut Self;
703 fn take_or_borrow<'a>(
704 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
705 ) -> Self::Borrowed<'a> {
706 value
707 }
708 }
709
710 unsafe impl fidl::encoding::TypeMarker for TestControllerCreateFullmacRequest {
711 type Owned = Self;
712
713 #[inline(always)]
714 fn inline_align(_context: fidl::encoding::Context) -> usize {
715 4
716 }
717
718 #[inline(always)]
719 fn inline_size(_context: fidl::encoding::Context) -> usize {
720 4
721 }
722 }
723
724 unsafe impl
725 fidl::encoding::Encode<
726 TestControllerCreateFullmacRequest,
727 fidl::encoding::DefaultFuchsiaResourceDialect,
728 > for &mut TestControllerCreateFullmacRequest
729 {
730 #[inline]
731 unsafe fn encode(
732 self,
733 encoder: &mut fidl::encoding::Encoder<
734 '_,
735 fidl::encoding::DefaultFuchsiaResourceDialect,
736 >,
737 offset: usize,
738 _depth: fidl::encoding::Depth,
739 ) -> fidl::Result<()> {
740 encoder.debug_check_bounds::<TestControllerCreateFullmacRequest>(offset);
741 fidl::encoding::Encode::<
743 TestControllerCreateFullmacRequest,
744 fidl::encoding::DefaultFuchsiaResourceDialect,
745 >::encode(
746 (<fidl::encoding::Endpoint<
747 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
748 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
749 &mut self.bridge_client
750 ),),
751 encoder,
752 offset,
753 _depth,
754 )
755 }
756 }
757 unsafe impl<
758 T0: fidl::encoding::Encode<
759 fidl::encoding::Endpoint<
760 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
761 >,
762 fidl::encoding::DefaultFuchsiaResourceDialect,
763 >,
764 >
765 fidl::encoding::Encode<
766 TestControllerCreateFullmacRequest,
767 fidl::encoding::DefaultFuchsiaResourceDialect,
768 > for (T0,)
769 {
770 #[inline]
771 unsafe fn encode(
772 self,
773 encoder: &mut fidl::encoding::Encoder<
774 '_,
775 fidl::encoding::DefaultFuchsiaResourceDialect,
776 >,
777 offset: usize,
778 depth: fidl::encoding::Depth,
779 ) -> fidl::Result<()> {
780 encoder.debug_check_bounds::<TestControllerCreateFullmacRequest>(offset);
781 self.0.encode(encoder, offset + 0, depth)?;
785 Ok(())
786 }
787 }
788
789 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
790 for TestControllerCreateFullmacRequest
791 {
792 #[inline(always)]
793 fn new_empty() -> Self {
794 Self {
795 bridge_client: fidl::new_empty!(
796 fidl::encoding::Endpoint<
797 fidl::endpoints::ClientEnd<
798 fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker,
799 >,
800 >,
801 fidl::encoding::DefaultFuchsiaResourceDialect
802 ),
803 }
804 }
805
806 #[inline]
807 unsafe fn decode(
808 &mut self,
809 decoder: &mut fidl::encoding::Decoder<
810 '_,
811 fidl::encoding::DefaultFuchsiaResourceDialect,
812 >,
813 offset: usize,
814 _depth: fidl::encoding::Depth,
815 ) -> fidl::Result<()> {
816 decoder.debug_check_bounds::<Self>(offset);
817 fidl::decode!(
819 fidl::encoding::Endpoint<
820 fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_fullmac::WlanFullmacImpl_Marker>,
821 >,
822 fidl::encoding::DefaultFuchsiaResourceDialect,
823 &mut self.bridge_client,
824 decoder,
825 offset + 0,
826 _depth
827 )?;
828 Ok(())
829 }
830 }
831
832 impl fidl::encoding::ResourceTypeMarker for TestControllerDeleteFullmacRequest {
833 type Borrowed<'a> = &'a mut Self;
834 fn take_or_borrow<'a>(
835 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
836 ) -> Self::Borrowed<'a> {
837 value
838 }
839 }
840
841 unsafe impl fidl::encoding::TypeMarker for TestControllerDeleteFullmacRequest {
842 type Owned = Self;
843
844 #[inline(always)]
845 fn inline_align(_context: fidl::encoding::Context) -> usize {
846 4
847 }
848
849 #[inline(always)]
850 fn inline_size(_context: fidl::encoding::Context) -> usize {
851 4
852 }
853 #[inline(always)]
854 fn encode_is_copy() -> bool {
855 true
856 }
857
858 #[inline(always)]
859 fn decode_is_copy() -> bool {
860 true
861 }
862 }
863
864 unsafe impl
865 fidl::encoding::Encode<
866 TestControllerDeleteFullmacRequest,
867 fidl::encoding::DefaultFuchsiaResourceDialect,
868 > for &mut TestControllerDeleteFullmacRequest
869 {
870 #[inline]
871 unsafe fn encode(
872 self,
873 encoder: &mut fidl::encoding::Encoder<
874 '_,
875 fidl::encoding::DefaultFuchsiaResourceDialect,
876 >,
877 offset: usize,
878 _depth: fidl::encoding::Depth,
879 ) -> fidl::Result<()> {
880 encoder.debug_check_bounds::<TestControllerDeleteFullmacRequest>(offset);
881 unsafe {
882 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
884 (buf_ptr as *mut TestControllerDeleteFullmacRequest)
885 .write_unaligned((self as *const TestControllerDeleteFullmacRequest).read());
886 }
889 Ok(())
890 }
891 }
892 unsafe impl<T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>>
893 fidl::encoding::Encode<
894 TestControllerDeleteFullmacRequest,
895 fidl::encoding::DefaultFuchsiaResourceDialect,
896 > for (T0,)
897 {
898 #[inline]
899 unsafe fn encode(
900 self,
901 encoder: &mut fidl::encoding::Encoder<
902 '_,
903 fidl::encoding::DefaultFuchsiaResourceDialect,
904 >,
905 offset: usize,
906 depth: fidl::encoding::Depth,
907 ) -> fidl::Result<()> {
908 encoder.debug_check_bounds::<TestControllerDeleteFullmacRequest>(offset);
909 self.0.encode(encoder, offset + 0, depth)?;
913 Ok(())
914 }
915 }
916
917 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
918 for TestControllerDeleteFullmacRequest
919 {
920 #[inline(always)]
921 fn new_empty() -> Self {
922 Self { id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect) }
923 }
924
925 #[inline]
926 unsafe fn decode(
927 &mut self,
928 decoder: &mut fidl::encoding::Decoder<
929 '_,
930 fidl::encoding::DefaultFuchsiaResourceDialect,
931 >,
932 offset: usize,
933 _depth: fidl::encoding::Depth,
934 ) -> fidl::Result<()> {
935 decoder.debug_check_bounds::<Self>(offset);
936 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
937 unsafe {
940 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
941 }
942 Ok(())
943 }
944 }
945
946 impl fidl::encoding::ResourceTypeMarker for TestControllerCreateFullmacResponse {
947 type Borrowed<'a> = &'a mut Self;
948 fn take_or_borrow<'a>(
949 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
950 ) -> Self::Borrowed<'a> {
951 value
952 }
953 }
954
955 unsafe impl fidl::encoding::TypeMarker for TestControllerCreateFullmacResponse {
956 type Owned = Self;
957
958 #[inline(always)]
959 fn inline_align(_context: fidl::encoding::Context) -> usize {
960 4
961 }
962
963 #[inline(always)]
964 fn inline_size(_context: fidl::encoding::Context) -> usize {
965 4
966 }
967 #[inline(always)]
968 fn encode_is_copy() -> bool {
969 true
970 }
971
972 #[inline(always)]
973 fn decode_is_copy() -> bool {
974 true
975 }
976 }
977
978 unsafe impl
979 fidl::encoding::Encode<
980 TestControllerCreateFullmacResponse,
981 fidl::encoding::DefaultFuchsiaResourceDialect,
982 > for &mut TestControllerCreateFullmacResponse
983 {
984 #[inline]
985 unsafe fn encode(
986 self,
987 encoder: &mut fidl::encoding::Encoder<
988 '_,
989 fidl::encoding::DefaultFuchsiaResourceDialect,
990 >,
991 offset: usize,
992 _depth: fidl::encoding::Depth,
993 ) -> fidl::Result<()> {
994 encoder.debug_check_bounds::<TestControllerCreateFullmacResponse>(offset);
995 unsafe {
996 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
998 (buf_ptr as *mut TestControllerCreateFullmacResponse)
999 .write_unaligned((self as *const TestControllerCreateFullmacResponse).read());
1000 }
1003 Ok(())
1004 }
1005 }
1006 unsafe impl<T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>>
1007 fidl::encoding::Encode<
1008 TestControllerCreateFullmacResponse,
1009 fidl::encoding::DefaultFuchsiaResourceDialect,
1010 > for (T0,)
1011 {
1012 #[inline]
1013 unsafe fn encode(
1014 self,
1015 encoder: &mut fidl::encoding::Encoder<
1016 '_,
1017 fidl::encoding::DefaultFuchsiaResourceDialect,
1018 >,
1019 offset: usize,
1020 depth: fidl::encoding::Depth,
1021 ) -> fidl::Result<()> {
1022 encoder.debug_check_bounds::<TestControllerCreateFullmacResponse>(offset);
1023 self.0.encode(encoder, offset + 0, depth)?;
1027 Ok(())
1028 }
1029 }
1030
1031 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1032 for TestControllerCreateFullmacResponse
1033 {
1034 #[inline(always)]
1035 fn new_empty() -> Self {
1036 Self { id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect) }
1037 }
1038
1039 #[inline]
1040 unsafe fn decode(
1041 &mut self,
1042 decoder: &mut fidl::encoding::Decoder<
1043 '_,
1044 fidl::encoding::DefaultFuchsiaResourceDialect,
1045 >,
1046 offset: usize,
1047 _depth: fidl::encoding::Depth,
1048 ) -> fidl::Result<()> {
1049 decoder.debug_check_bounds::<Self>(offset);
1050 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1051 unsafe {
1054 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1055 }
1056 Ok(())
1057 }
1058 }
1059}