fidl_fuchsia_wlan_product_deprecatedconfiguration/
fidl_fuchsia_wlan_product_deprecatedconfiguration.rs1#![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_wlan_product_deprecatedconfiguration__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct DeprecatedConfiguratorMarker;
16
17impl fidl::endpoints::ProtocolMarker for DeprecatedConfiguratorMarker {
18 type Proxy = DeprecatedConfiguratorProxy;
19 type RequestStream = DeprecatedConfiguratorRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = DeprecatedConfiguratorSynchronousProxy;
22
23 const DEBUG_NAME: &'static str =
24 "fuchsia.wlan.product.deprecatedconfiguration.DeprecatedConfigurator";
25}
26impl fidl::endpoints::DiscoverableProtocolMarker for DeprecatedConfiguratorMarker {}
27pub type DeprecatedConfiguratorSuggestAccessPointMacAddressResult =
28 Result<(), SuggestMacAddressError>;
29
30pub trait DeprecatedConfiguratorProxyInterface: Send + Sync {
31 type SuggestAccessPointMacAddressResponseFut: std::future::Future<
32 Output = Result<DeprecatedConfiguratorSuggestAccessPointMacAddressResult, fidl::Error>,
33 > + Send;
34 fn r#suggest_access_point_mac_address(
35 &self,
36 mac: &fidl_fuchsia_net::MacAddress,
37 ) -> Self::SuggestAccessPointMacAddressResponseFut;
38}
39#[derive(Debug)]
40#[cfg(target_os = "fuchsia")]
41pub struct DeprecatedConfiguratorSynchronousProxy {
42 client: fidl::client::sync::Client,
43}
44
45#[cfg(target_os = "fuchsia")]
46impl fidl::endpoints::SynchronousProxy for DeprecatedConfiguratorSynchronousProxy {
47 type Proxy = DeprecatedConfiguratorProxy;
48 type Protocol = DeprecatedConfiguratorMarker;
49
50 fn from_channel(inner: fidl::Channel) -> Self {
51 Self::new(inner)
52 }
53
54 fn into_channel(self) -> fidl::Channel {
55 self.client.into_channel()
56 }
57
58 fn as_channel(&self) -> &fidl::Channel {
59 self.client.as_channel()
60 }
61}
62
63#[cfg(target_os = "fuchsia")]
64impl DeprecatedConfiguratorSynchronousProxy {
65 pub fn new(channel: fidl::Channel) -> Self {
66 Self { client: fidl::client::sync::Client::new(channel) }
67 }
68
69 pub fn into_channel(self) -> fidl::Channel {
70 self.client.into_channel()
71 }
72
73 pub fn wait_for_event(
76 &self,
77 deadline: zx::MonotonicInstant,
78 ) -> Result<DeprecatedConfiguratorEvent, fidl::Error> {
79 DeprecatedConfiguratorEvent::decode(
80 self.client.wait_for_event::<DeprecatedConfiguratorMarker>(deadline)?,
81 )
82 }
83
84 pub fn r#suggest_access_point_mac_address(
87 &self,
88 mut mac: &fidl_fuchsia_net::MacAddress,
89 ___deadline: zx::MonotonicInstant,
90 ) -> Result<DeprecatedConfiguratorSuggestAccessPointMacAddressResult, fidl::Error> {
91 let _response = self.client.send_query::<
92 DeprecatedConfiguratorSuggestAccessPointMacAddressRequest,
93 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, SuggestMacAddressError>,
94 DeprecatedConfiguratorMarker,
95 >(
96 (mac,),
97 0x4dedf25064024f8c,
98 fidl::encoding::DynamicFlags::empty(),
99 ___deadline,
100 )?;
101 Ok(_response.map(|x| x))
102 }
103}
104
105#[cfg(target_os = "fuchsia")]
106impl From<DeprecatedConfiguratorSynchronousProxy> for zx::NullableHandle {
107 fn from(value: DeprecatedConfiguratorSynchronousProxy) -> Self {
108 value.into_channel().into()
109 }
110}
111
112#[cfg(target_os = "fuchsia")]
113impl From<fidl::Channel> for DeprecatedConfiguratorSynchronousProxy {
114 fn from(value: fidl::Channel) -> Self {
115 Self::new(value)
116 }
117}
118
119#[cfg(target_os = "fuchsia")]
120impl fidl::endpoints::FromClient for DeprecatedConfiguratorSynchronousProxy {
121 type Protocol = DeprecatedConfiguratorMarker;
122
123 fn from_client(value: fidl::endpoints::ClientEnd<DeprecatedConfiguratorMarker>) -> Self {
124 Self::new(value.into_channel())
125 }
126}
127
128#[derive(Debug, Clone)]
129pub struct DeprecatedConfiguratorProxy {
130 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
131}
132
133impl fidl::endpoints::Proxy for DeprecatedConfiguratorProxy {
134 type Protocol = DeprecatedConfiguratorMarker;
135
136 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
137 Self::new(inner)
138 }
139
140 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
141 self.client.into_channel().map_err(|client| Self { client })
142 }
143
144 fn as_channel(&self) -> &::fidl::AsyncChannel {
145 self.client.as_channel()
146 }
147}
148
149impl DeprecatedConfiguratorProxy {
150 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
152 let protocol_name =
153 <DeprecatedConfiguratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
154 Self { client: fidl::client::Client::new(channel, protocol_name) }
155 }
156
157 pub fn take_event_stream(&self) -> DeprecatedConfiguratorEventStream {
163 DeprecatedConfiguratorEventStream { event_receiver: self.client.take_event_receiver() }
164 }
165
166 pub fn r#suggest_access_point_mac_address(
169 &self,
170 mut mac: &fidl_fuchsia_net::MacAddress,
171 ) -> fidl::client::QueryResponseFut<
172 DeprecatedConfiguratorSuggestAccessPointMacAddressResult,
173 fidl::encoding::DefaultFuchsiaResourceDialect,
174 > {
175 DeprecatedConfiguratorProxyInterface::r#suggest_access_point_mac_address(self, mac)
176 }
177}
178
179impl DeprecatedConfiguratorProxyInterface for DeprecatedConfiguratorProxy {
180 type SuggestAccessPointMacAddressResponseFut = fidl::client::QueryResponseFut<
181 DeprecatedConfiguratorSuggestAccessPointMacAddressResult,
182 fidl::encoding::DefaultFuchsiaResourceDialect,
183 >;
184 fn r#suggest_access_point_mac_address(
185 &self,
186 mut mac: &fidl_fuchsia_net::MacAddress,
187 ) -> Self::SuggestAccessPointMacAddressResponseFut {
188 fn _decode(
189 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
190 ) -> Result<DeprecatedConfiguratorSuggestAccessPointMacAddressResult, fidl::Error> {
191 let _response = fidl::client::decode_transaction_body::<
192 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, SuggestMacAddressError>,
193 fidl::encoding::DefaultFuchsiaResourceDialect,
194 0x4dedf25064024f8c,
195 >(_buf?)?;
196 Ok(_response.map(|x| x))
197 }
198 self.client.send_query_and_decode::<
199 DeprecatedConfiguratorSuggestAccessPointMacAddressRequest,
200 DeprecatedConfiguratorSuggestAccessPointMacAddressResult,
201 >(
202 (mac,),
203 0x4dedf25064024f8c,
204 fidl::encoding::DynamicFlags::empty(),
205 _decode,
206 )
207 }
208}
209
210pub struct DeprecatedConfiguratorEventStream {
211 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
212}
213
214impl std::marker::Unpin for DeprecatedConfiguratorEventStream {}
215
216impl futures::stream::FusedStream for DeprecatedConfiguratorEventStream {
217 fn is_terminated(&self) -> bool {
218 self.event_receiver.is_terminated()
219 }
220}
221
222impl futures::Stream for DeprecatedConfiguratorEventStream {
223 type Item = Result<DeprecatedConfiguratorEvent, fidl::Error>;
224
225 fn poll_next(
226 mut self: std::pin::Pin<&mut Self>,
227 cx: &mut std::task::Context<'_>,
228 ) -> std::task::Poll<Option<Self::Item>> {
229 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
230 &mut self.event_receiver,
231 cx
232 )?) {
233 Some(buf) => std::task::Poll::Ready(Some(DeprecatedConfiguratorEvent::decode(buf))),
234 None => std::task::Poll::Ready(None),
235 }
236 }
237}
238
239#[derive(Debug)]
240pub enum DeprecatedConfiguratorEvent {}
241
242impl DeprecatedConfiguratorEvent {
243 fn decode(
245 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
246 ) -> Result<DeprecatedConfiguratorEvent, fidl::Error> {
247 let (bytes, _handles) = buf.split_mut();
248 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
249 debug_assert_eq!(tx_header.tx_id, 0);
250 match tx_header.ordinal {
251 _ => Err(fidl::Error::UnknownOrdinal {
252 ordinal: tx_header.ordinal,
253 protocol_name:
254 <DeprecatedConfiguratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
255 }),
256 }
257 }
258}
259
260pub struct DeprecatedConfiguratorRequestStream {
262 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
263 is_terminated: bool,
264}
265
266impl std::marker::Unpin for DeprecatedConfiguratorRequestStream {}
267
268impl futures::stream::FusedStream for DeprecatedConfiguratorRequestStream {
269 fn is_terminated(&self) -> bool {
270 self.is_terminated
271 }
272}
273
274impl fidl::endpoints::RequestStream for DeprecatedConfiguratorRequestStream {
275 type Protocol = DeprecatedConfiguratorMarker;
276 type ControlHandle = DeprecatedConfiguratorControlHandle;
277
278 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
279 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
280 }
281
282 fn control_handle(&self) -> Self::ControlHandle {
283 DeprecatedConfiguratorControlHandle { inner: self.inner.clone() }
284 }
285
286 fn into_inner(
287 self,
288 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
289 {
290 (self.inner, self.is_terminated)
291 }
292
293 fn from_inner(
294 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
295 is_terminated: bool,
296 ) -> Self {
297 Self { inner, is_terminated }
298 }
299}
300
301impl futures::Stream for DeprecatedConfiguratorRequestStream {
302 type Item = Result<DeprecatedConfiguratorRequest, fidl::Error>;
303
304 fn poll_next(
305 mut self: std::pin::Pin<&mut Self>,
306 cx: &mut std::task::Context<'_>,
307 ) -> std::task::Poll<Option<Self::Item>> {
308 let this = &mut *self;
309 if this.inner.check_shutdown(cx) {
310 this.is_terminated = true;
311 return std::task::Poll::Ready(None);
312 }
313 if this.is_terminated {
314 panic!("polled DeprecatedConfiguratorRequestStream after completion");
315 }
316 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
317 |bytes, handles| {
318 match this.inner.channel().read_etc(cx, bytes, handles) {
319 std::task::Poll::Ready(Ok(())) => {}
320 std::task::Poll::Pending => return std::task::Poll::Pending,
321 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
322 this.is_terminated = true;
323 return std::task::Poll::Ready(None);
324 }
325 std::task::Poll::Ready(Err(e)) => {
326 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
327 e.into(),
328 ))));
329 }
330 }
331
332 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
334
335 std::task::Poll::Ready(Some(match header.ordinal {
336 0x4dedf25064024f8c => {
337 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
338 let mut req = fidl::new_empty!(DeprecatedConfiguratorSuggestAccessPointMacAddressRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
339 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeprecatedConfiguratorSuggestAccessPointMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
340 let control_handle = DeprecatedConfiguratorControlHandle {
341 inner: this.inner.clone(),
342 };
343 Ok(DeprecatedConfiguratorRequest::SuggestAccessPointMacAddress {mac: req.mac,
344
345 responder: DeprecatedConfiguratorSuggestAccessPointMacAddressResponder {
346 control_handle: std::mem::ManuallyDrop::new(control_handle),
347 tx_id: header.tx_id,
348 },
349 })
350 }
351 _ => Err(fidl::Error::UnknownOrdinal {
352 ordinal: header.ordinal,
353 protocol_name: <DeprecatedConfiguratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
354 }),
355 }))
356 },
357 )
358 }
359}
360
361#[derive(Debug)]
363pub enum DeprecatedConfiguratorRequest {
364 SuggestAccessPointMacAddress {
367 mac: fidl_fuchsia_net::MacAddress,
368 responder: DeprecatedConfiguratorSuggestAccessPointMacAddressResponder,
369 },
370}
371
372impl DeprecatedConfiguratorRequest {
373 #[allow(irrefutable_let_patterns)]
374 pub fn into_suggest_access_point_mac_address(
375 self,
376 ) -> Option<(
377 fidl_fuchsia_net::MacAddress,
378 DeprecatedConfiguratorSuggestAccessPointMacAddressResponder,
379 )> {
380 if let DeprecatedConfiguratorRequest::SuggestAccessPointMacAddress { mac, responder } = self
381 {
382 Some((mac, responder))
383 } else {
384 None
385 }
386 }
387
388 pub fn method_name(&self) -> &'static str {
390 match *self {
391 DeprecatedConfiguratorRequest::SuggestAccessPointMacAddress { .. } => {
392 "suggest_access_point_mac_address"
393 }
394 }
395 }
396}
397
398#[derive(Debug, Clone)]
399pub struct DeprecatedConfiguratorControlHandle {
400 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
401}
402
403impl fidl::endpoints::ControlHandle for DeprecatedConfiguratorControlHandle {
404 fn shutdown(&self) {
405 self.inner.shutdown()
406 }
407
408 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
409 self.inner.shutdown_with_epitaph(status)
410 }
411
412 fn is_closed(&self) -> bool {
413 self.inner.channel().is_closed()
414 }
415 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
416 self.inner.channel().on_closed()
417 }
418
419 #[cfg(target_os = "fuchsia")]
420 fn signal_peer(
421 &self,
422 clear_mask: zx::Signals,
423 set_mask: zx::Signals,
424 ) -> Result<(), zx_status::Status> {
425 use fidl::Peered;
426 self.inner.channel().signal_peer(clear_mask, set_mask)
427 }
428}
429
430impl DeprecatedConfiguratorControlHandle {}
431
432#[must_use = "FIDL methods require a response to be sent"]
433#[derive(Debug)]
434pub struct DeprecatedConfiguratorSuggestAccessPointMacAddressResponder {
435 control_handle: std::mem::ManuallyDrop<DeprecatedConfiguratorControlHandle>,
436 tx_id: u32,
437}
438
439impl std::ops::Drop for DeprecatedConfiguratorSuggestAccessPointMacAddressResponder {
443 fn drop(&mut self) {
444 self.control_handle.shutdown();
445 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
447 }
448}
449
450impl fidl::endpoints::Responder for DeprecatedConfiguratorSuggestAccessPointMacAddressResponder {
451 type ControlHandle = DeprecatedConfiguratorControlHandle;
452
453 fn control_handle(&self) -> &DeprecatedConfiguratorControlHandle {
454 &self.control_handle
455 }
456
457 fn drop_without_shutdown(mut self) {
458 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
460 std::mem::forget(self);
462 }
463}
464
465impl DeprecatedConfiguratorSuggestAccessPointMacAddressResponder {
466 pub fn send(self, mut result: Result<(), SuggestMacAddressError>) -> Result<(), fidl::Error> {
470 let _result = self.send_raw(result);
471 if _result.is_err() {
472 self.control_handle.shutdown();
473 }
474 self.drop_without_shutdown();
475 _result
476 }
477
478 pub fn send_no_shutdown_on_err(
480 self,
481 mut result: Result<(), SuggestMacAddressError>,
482 ) -> Result<(), fidl::Error> {
483 let _result = self.send_raw(result);
484 self.drop_without_shutdown();
485 _result
486 }
487
488 fn send_raw(&self, mut result: Result<(), SuggestMacAddressError>) -> Result<(), fidl::Error> {
489 self.control_handle.inner.send::<fidl::encoding::ResultType<
490 fidl::encoding::EmptyStruct,
491 SuggestMacAddressError,
492 >>(
493 result,
494 self.tx_id,
495 0x4dedf25064024f8c,
496 fidl::encoding::DynamicFlags::empty(),
497 )
498 }
499}
500
501mod internal {
502 use super::*;
503}