flex_client/
flex.rs

1// Copyright 2025 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use fuchsia_async as _;
6
7#[cfg(feature = "fdomain")]
8pub use fdomain_client::*;
9
10#[cfg(feature = "fdomain")]
11pub type Dialect = fdomain_client::fidl::FDomainResourceDialect;
12
13#[cfg(not(feature = "fdomain"))]
14pub type Dialect = ::fidl::encoding::DefaultFuchsiaResourceDialect;
15
16#[cfg(feature = "fdomain")]
17pub use fdomain_client::Channel as AsyncChannel;
18
19#[cfg(feature = "fdomain")]
20pub use fdomain_client::Socket as AsyncSocket;
21
22#[cfg(feature = "fdomain")]
23pub fn socket_to_async(s: AsyncSocket) -> AsyncSocket {
24    s
25}
26
27#[cfg(not(feature = "fdomain"))]
28pub fn socket_to_async(s: Socket) -> AsyncSocket {
29    AsyncSocket::from_socket(s)
30}
31
32#[cfg(not(feature = "fdomain"))]
33pub use ::fidl::endpoints::ProxyHasDomain;
34
35#[cfg(feature = "fdomain")]
36pub use fdomain_client::fidl::Proxy as ProxyHasDomain;
37
38#[cfg(not(feature = "fdomain"))]
39pub use ::fidl::*;
40
41#[cfg(not(feature = "fdomain"))]
42#[cfg(target_os = "fuchsia")]
43pub use zx::MessageBuf;
44
45#[cfg(not(feature = "fdomain"))]
46#[cfg(not(target_os = "fuchsia"))]
47pub use fuchsia_async::emulated_handle::MessageBuf;
48
49#[cfg(not(feature = "fdomain"))]
50pub mod fidl {
51    pub use ::fidl::endpoints::*;
52}