iota_sdk_graphql_client/api/
mod.rs1pub(crate) mod balance;
8pub(crate) mod checkpoints;
9pub(crate) mod coins;
10pub(crate) mod dry_run;
11pub(crate) mod dynamic_fields;
12pub(crate) mod epochs;
13pub(crate) mod events;
14pub(crate) mod iota_names;
15#[cfg(feature = "move-types")]
16pub(crate) mod move_objects;
17pub(crate) mod move_view_call;
18pub(crate) mod network;
19pub(crate) mod objects;
20pub(crate) mod package;
21pub(crate) mod transactions;
22
23#[cfg(not(target_arch = "wasm32"))]
24pub(crate) type QueryFuture<T> = futures::future::BoxFuture<'static, T>;
25#[cfg(target_arch = "wasm32")]
27pub(crate) type QueryFuture<T> = futures::future::LocalBoxFuture<'static, T>;
28
29macro_rules! define_query {
35 (
36 $(#[$meta:meta])*
37 pub struct $name:ident $(<$generic:ident: $bound:path>)? {
38 $($field:ident: $field_ty:ty),* $(,)?
39 }
40 output: $output:ty;
41 ) => {
42 $(#[$meta])*
43 #[must_use]
44 pub struct $name $(<$generic>)? {
45 $($field: $field_ty,)*
46 }
47
48 impl $(<$generic: $bound + 'static>)? ::std::future::IntoFuture for $name $(<$generic>)? {
49 type Output = $output;
50 type IntoFuture = $crate::api::QueryFuture<Self::Output>;
51
52 fn into_future(self) -> Self::IntoFuture {
53 Box::pin(self.send())
54 }
55 }
56 };
57}
58
59pub(crate) use define_query;