Skip to main content

ic_query/
lib.rs

1//! Reusable report models and helpers for Internet Computer metadata queries.
2//!
3//! The default feature set is empty. A dependency using
4//! `default-features = false` gets the pure report DTOs, renderers, and local
5//! parsing/resolution helpers that are intended to stay free of native
6//! live-call dependencies.
7//!
8//! This is a host dependency boundary, not a `no_std` promise. No-default
9//! builds are expected to compile for `wasm32-unknown-unknown` without
10//! `ic-agent`, Reqwest, Tokio, or `futures-util`, but they may still use ordinary
11//! `std` types such as `String` and `Vec`.
12//!
13//! Enable `dashboard-host` for official Dashboard live/cache APIs,
14//! `ic-state-host` for certified IC state-tree reports,
15//! `cloud-engine-host` for native CloudEngine control-plane reports (combine it
16//! with `subnet-catalog-host` for the Registry-backed CloudEngine list),
17//! `icrc-host` for native ICRC ledger/index APIs, `sns-host` for native SNS
18//! live/cache APIs, `cmc-host` for certified Cycles Minting Canister reports,
19//! `subnet-catalog-host` for the focused live/cache Subnet catalog API,
20//! `certified-subnet-catalog-host` for that API plus certified Registry archive,
21//! replay, and archive-bound catalog authority,
22//! `nns-topology-host` for that API plus exact-version joined NNS Subnet
23//! topology, `nns-host` for the complete NNS host surface, `canister` for the
24//! replicated NNS Governance adapter on `wasm32`, or `host` for every native
25//! live-call adapter. CLI parsing and process IO belong to
26//! the separate `ic-query-cli` crate.
27
28#[cfg(any(
29    feature = "cloud-engine-host",
30    feature = "cmc-host",
31    feature = "ic-state-host",
32    feature = "icrc-host",
33    feature = "sns-host",
34    feature = "subnet-catalog-host"
35))]
36mod agent;
37#[cfg(any(
38    feature = "cloud-engine-host",
39    feature = "cmc-host",
40    feature = "icrc-host",
41    feature = "sns-host",
42    feature = "subnet-catalog-host"
43))]
44mod agent_transport;
45pub mod cache;
46#[cfg(any(
47    feature = "dashboard-host",
48    feature = "icrc-host",
49    feature = "sns-host",
50    feature = "subnet-catalog-host"
51))]
52mod cache_file;
53#[cfg(any(
54    feature = "cloud-engine-host",
55    feature = "icrc-host",
56    feature = "nns-host",
57    feature = "sns-host"
58))]
59mod candid_call;
60#[cfg(any(
61    test,
62    all(feature = "canister", target_arch = "wasm32"),
63    feature = "cloud-engine-host",
64    feature = "cmc-host",
65    feature = "icrc-host",
66    feature = "sns-host",
67    feature = "subnet-catalog-host"
68))]
69mod candid_decode;
70#[cfg(feature = "certificate-host")]
71pub mod certificate;
72#[cfg(any(
73    feature = "certified-subnet-catalog-host",
74    feature = "cmc-host",
75    feature = "ic-state-host",
76    feature = "icrc-host"
77))]
78mod certification;
79pub mod cloud_engine;
80#[cfg(any(
81    feature = "cloud-engine-host",
82    feature = "dashboard-host",
83    feature = "icrc-host",
84    feature = "sns-host"
85))]
86mod decimal;
87#[cfg(any(
88    feature = "dashboard-host",
89    feature = "icrc-host",
90    feature = "sns-host",
91    feature = "subnet-catalog-host"
92))]
93mod freshness;
94mod hex;
95mod http_endpoint;
96mod human_quantity;
97pub mod ic;
98#[cfg(feature = "subnet-catalog-host")]
99mod ic_registry;
100pub mod icrc;
101#[cfg(any(
102    feature = "cloud-engine-host",
103    feature = "cmc-host",
104    feature = "dashboard-host",
105    feature = "sns-host",
106    feature = "subnet-catalog-host"
107))]
108mod network;
109pub mod nns;
110mod principal_text;
111#[cfg(any(
112    feature = "dashboard-host",
113    feature = "icrc-host",
114    feature = "nns-host",
115    feature = "sns-host",
116    feature = "subnet-catalog-host"
117))]
118mod progress;
119pub mod report;
120mod report_sort;
121#[cfg(any(
122    feature = "dashboard-host",
123    feature = "icrc-host",
124    feature = "nns-host",
125    feature = "sns-host"
126))]
127pub(crate) mod snapshot_cache;
128pub mod sns;
129pub mod subnet_catalog;
130pub mod system;
131
132#[cfg(any(
133    feature = "dashboard-host",
134    feature = "icrc-host",
135    feature = "sns-host",
136    feature = "subnet-catalog-host"
137))]
138pub use cache_file::{CacheFileError, HostCacheError};
139mod text_search;
140mod text_value;
141mod token_amount;
142mod token_metadata_text;
143
144#[cfg(all(
145    test,
146    any(
147        feature = "dashboard-host",
148        feature = "icrc-host",
149        feature = "sns-host",
150        feature = "subnet-catalog-host"
151    )
152))]
153mod test_support;
154
155#[cfg(test)]
156mod tests;
157
158#[cfg(any(
159    feature = "dashboard-host",
160    feature = "icrc-host",
161    feature = "nns-host",
162    feature = "sns-host",
163    feature = "subnet-catalog-host"
164))]
165pub use progress::{QueryProgress, QueryProgressEvent, QueryProgressState};