fidl_test_structuredconfig_receiver_shim/
fidl_test_structuredconfig_receiver_shim.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// WARNING: This file is machine generated by fidlgen.

#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]

use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;

#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ConfigServiceMarker;

#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for ConfigServiceMarker {
    type Proxy = ConfigServiceProxy;
    type Request = ConfigServiceRequest;
    const SERVICE_NAME: &'static str = "test.structuredconfig.receiver.shim.ConfigService";
}

/// A request for one of the member protocols of ConfigService.
///
#[cfg(target_os = "fuchsia")]
pub enum ConfigServiceRequest {
    Puppet(fidl_test_structuredconfig_receiver::ConfigReceiverPuppetRequestStream),
}

#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for ConfigServiceRequest {
    type Service = ConfigServiceMarker;

    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
        match name {
            "puppet" => Self::Puppet(
                <fidl_test_structuredconfig_receiver::ConfigReceiverPuppetRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
            ),
            _ => panic!("no such member protocol name for service ConfigService"),
        }
    }

    fn member_names() -> &'static [&'static str] {
        &["puppet"]
    }
}
#[cfg(target_os = "fuchsia")]
pub struct ConfigServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);

#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for ConfigServiceProxy {
    type Service = ConfigServiceMarker;

    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
        Self(opener)
    }
}

#[cfg(target_os = "fuchsia")]
impl ConfigServiceProxy {
    pub fn connect_to_puppet(
        &self,
    ) -> Result<fidl_test_structuredconfig_receiver::ConfigReceiverPuppetProxy, fidl::Error> {
        let (proxy, server_end) = fidl::endpoints::create_proxy::<
            fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
        >();
        self.connect_channel_to_puppet(server_end)?;
        Ok(proxy)
    }

    /// Like `connect_to_puppet`, but returns a sync proxy.
    /// See [`Self::connect_to_puppet`] for more details.
    pub fn connect_to_puppet_sync(
        &self,
    ) -> Result<
        fidl_test_structuredconfig_receiver::ConfigReceiverPuppetSynchronousProxy,
        fidl::Error,
    > {
        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<
            fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
        >();
        self.connect_channel_to_puppet(server_end)?;
        Ok(proxy)
    }

    /// Like `connect_to_puppet`, but accepts a server end.
    /// See [`Self::connect_to_puppet`] for more details.
    pub fn connect_channel_to_puppet(
        &self,
        server_end: fidl::endpoints::ServerEnd<
            fidl_test_structuredconfig_receiver::ConfigReceiverPuppetMarker,
        >,
    ) -> Result<(), fidl::Error> {
        self.0.open_member("puppet", server_end.into_channel())
    }
}

mod internal {
    use super::*;
}