dapi_grpc/
lib.rs

1pub use prost::Message;
2
3#[cfg(feature = "core")]
4pub mod core {
5    #![allow(non_camel_case_types)]
6    pub mod v0 {
7        // Note: only one of the features can be analyzed at a time
8        #[cfg(all(feature = "server", not(target_arch = "wasm32")))]
9        include!(concat!(
10            env!("DAPI_GRPC_OUT_DIR"),
11            "/core/server/org.dash.platform.dapi.v0.rs"
12        ));
13
14        #[cfg(all(
15            feature = "client",
16            not(feature = "server"),
17            not(target_arch = "wasm32")
18        ))]
19        include!(concat!(
20            env!("DAPI_GRPC_OUT_DIR"),
21            "/core/client/org.dash.platform.dapi.v0.rs"
22        ));
23
24        #[cfg(target_arch = "wasm32")]
25        include!(concat!(
26            env!("DAPI_GRPC_OUT_DIR"),
27            "/core/wasm/org.dash.platform.dapi.v0.rs"
28        ));
29    }
30}
31
32#[cfg(feature = "platform")]
33pub mod platform {
34    pub mod v0 {
35        #[cfg(all(feature = "server", not(target_arch = "wasm32")))]
36        include!(concat!(
37            env!("DAPI_GRPC_OUT_DIR"),
38            "/platform/server/org.dash.platform.dapi.v0.rs"
39        ));
40
41        #[cfg(all(
42            feature = "client",
43            not(feature = "server"),
44            not(target_arch = "wasm32")
45        ))]
46        include!(concat!(
47            env!("DAPI_GRPC_OUT_DIR"),
48            "/platform/client/org.dash.platform.dapi.v0.rs"
49        ));
50
51        #[cfg(target_arch = "wasm32")]
52        include!(concat!(
53            env!("DAPI_GRPC_OUT_DIR"),
54            "/platform/wasm/org.dash.platform.dapi.v0.rs"
55        ));
56    }
57
58    #[cfg(feature = "tenderdash-proto")]
59    pub use tenderdash_proto as proto;
60
61    #[cfg(any(feature = "server", feature = "client", target_arch = "wasm32"))]
62    mod versioning;
63    #[cfg(any(feature = "server", feature = "client", target_arch = "wasm32"))]
64    pub use versioning::{
65        MerkProofVersionedGrpcResponse, VersionedGrpcMessage, VersionedGrpcResponse,
66    };
67}
68
69#[cfg(all(feature = "drive", feature = "platform"))]
70pub(crate) mod dapi {
71    pub(crate) use crate::platform::*;
72}
73
74#[cfg(feature = "drive")]
75pub mod drive {
76    pub mod v0 {
77        #[cfg(all(feature = "server", not(target_arch = "wasm32")))]
78        include!(concat!(
79            env!("DAPI_GRPC_OUT_DIR"),
80            "/drive/server/org.dash.platform.drive.v0.rs"
81        ));
82
83        #[cfg(all(
84            feature = "client",
85            not(feature = "server"),
86            not(target_arch = "wasm32")
87        ))]
88        include!(concat!(
89            env!("DAPI_GRPC_OUT_DIR"),
90            "/drive/client/org.dash.platform.drive.v0.rs"
91        ));
92    }
93
94    #[cfg(feature = "tenderdash-proto")]
95    pub use tenderdash_proto as proto;
96}
97
98#[cfg(feature = "serde")]
99// Serde deserialization logic
100pub mod deserialization;
101
102// We need mock module even if the feature is disabled
103pub mod mock;
104
105// Re-export tonic to ensure everyone uses the same version
106pub use tonic;
107// Ensure the prost codec crate is linked and available to generated code
108pub use tonic_prost;