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;
101mod identifier_match;
102#[cfg(any(
103    feature = "cloud-engine-host",
104    feature = "cmc-host",
105    feature = "dashboard-host",
106    feature = "sns-host",
107    feature = "subnet-catalog-host"
108))]
109mod network;
110pub mod nns;
111mod principal_text;
112#[cfg(any(
113    feature = "dashboard-host",
114    feature = "icrc-host",
115    feature = "nns-host",
116    feature = "sns-host",
117    feature = "subnet-catalog-host"
118))]
119mod progress;
120pub mod report;
121mod report_sort;
122#[cfg(any(
123    feature = "dashboard-host",
124    feature = "icrc-host",
125    feature = "nns-host",
126    feature = "sns-host"
127))]
128pub(crate) mod snapshot_cache;
129pub mod sns;
130pub mod subnet_catalog;
131pub mod system;
132
133#[cfg(any(
134    feature = "dashboard-host",
135    feature = "icrc-host",
136    feature = "sns-host",
137    feature = "subnet-catalog-host"
138))]
139pub use cache_file::{CacheFileError, HostCacheError};
140mod text_search;
141mod text_value;
142mod token_amount;
143mod token_metadata_text;
144
145#[cfg(all(
146    test,
147    any(
148        feature = "dashboard-host",
149        feature = "icrc-host",
150        feature = "sns-host",
151        feature = "subnet-catalog-host"
152    )
153))]
154mod test_support;
155
156#[cfg(test)]
157mod tests;
158
159#[cfg(any(
160    feature = "dashboard-host",
161    feature = "icrc-host",
162    feature = "nns-host",
163    feature = "sns-host",
164    feature = "subnet-catalog-host"
165))]
166pub use progress::{QueryProgress, QueryProgressEvent, QueryProgressState};