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, JSON contracts, and local
5//! parsing/resolution helpers that are intended to stay free of native
6//! live-call dependencies. Human-facing rendering lives in `ic-query-text`.
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 explicitly targeted Governance neuron
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//! `nns-topology-host` for that API plus exact-version joined NNS Subnet
21//! topology, `nns-host` for the complete NNS host surface, `canister` for the
22//! replicated NNS Governance adapter on `wasm32`, or `host` for every native
23//! live-call adapter. CLI parsing and process IO belong to
24//! the separate `ic-query-cli` crate.
25
26#[cfg(any(
27    feature = "cloud-engine-host",
28    feature = "cmc-host",
29    feature = "ic-state-host",
30    feature = "icrc-host",
31    feature = "sns-host",
32    feature = "subnet-catalog-host"
33))]
34mod agent;
35#[cfg(any(
36    feature = "cloud-engine-host",
37    feature = "cmc-host",
38    feature = "icrc-host",
39    feature = "sns-host",
40    feature = "subnet-catalog-host"
41))]
42mod agent_transport;
43pub mod cache;
44#[cfg(any(
45    feature = "dashboard-host",
46    feature = "icrc-host",
47    feature = "sns-host",
48    feature = "subnet-catalog-host"
49))]
50mod cache_file;
51#[cfg(any(
52    feature = "cloud-engine-host",
53    feature = "cmc-host",
54    feature = "icrc-host",
55    feature = "nns-host",
56    feature = "sns-host"
57))]
58mod candid_call;
59#[cfg(any(
60    test,
61    all(feature = "canister", target_arch = "wasm32"),
62    feature = "cloud-engine-host",
63    feature = "cmc-host",
64    feature = "icrc-host",
65    feature = "sns-host",
66    feature = "subnet-catalog-host"
67))]
68mod candid_decode;
69#[cfg(feature = "certificate-host")]
70pub mod certificate;
71#[cfg(any(
72    feature = "nns-host",
73    feature = "cmc-host",
74    feature = "ic-state-host",
75    feature = "icrc-host"
76))]
77mod certification;
78pub mod cloud_engine;
79#[cfg(any(
80    feature = "cloud-engine-host",
81    feature = "dashboard-host",
82    feature = "icrc-host"
83))]
84mod decimal;
85#[cfg(any(
86    feature = "dashboard-host",
87    feature = "icrc-host",
88    feature = "subnet-catalog-host"
89))]
90mod freshness;
91mod hex;
92mod http_endpoint;
93pub mod ic;
94#[cfg(feature = "subnet-catalog-host")]
95mod ic_registry;
96pub mod icrc;
97mod identifier_match;
98#[cfg(any(
99    feature = "cloud-engine-host",
100    feature = "cmc-host",
101    feature = "dashboard-host",
102    feature = "sns-host",
103    feature = "subnet-catalog-host"
104))]
105mod network;
106pub mod nns;
107mod principal_text;
108#[cfg(any(
109    feature = "dashboard-host",
110    feature = "icrc-host",
111    feature = "nns-host",
112    feature = "sns-host",
113    feature = "subnet-catalog-host"
114))]
115mod progress;
116pub mod report;
117mod report_sort;
118#[cfg(any(
119    feature = "dashboard-host",
120    feature = "icrc-host",
121    feature = "nns-host",
122    feature = "sns-host"
123))]
124pub(crate) mod snapshot_cache;
125pub mod sns;
126pub mod subnet_catalog;
127pub mod system;
128
129#[cfg(any(
130    feature = "dashboard-host",
131    feature = "icrc-host",
132    feature = "sns-host",
133    feature = "subnet-catalog-host"
134))]
135pub use cache_file::{CacheFileError, HostCacheError};
136mod text_search;
137
138#[cfg(all(
139    test,
140    any(
141        feature = "dashboard-host",
142        feature = "icrc-host",
143        feature = "sns-host",
144        feature = "subnet-catalog-host"
145    )
146))]
147mod tests;
148
149#[cfg(any(
150    feature = "dashboard-host",
151    feature = "icrc-host",
152    feature = "nns-host",
153    feature = "sns-host",
154    feature = "subnet-catalog-host"
155))]
156pub use progress::{
157    PagedQueryProgress, QueryProgress, QueryProgressCollection, QueryProgressEvent,
158    QueryProgressState,
159};