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_cli::presentation`.
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//! Candid, `ic-agent`, Reqwest, Tokio, or `futures-util`. Principal-valued report
11//! fields use `ic_platform_types::Principal`; protocol adapters select Candid
12//! explicitly. Portable builds may still use ordinary
13//! `std` types such as `String` and `Vec`.
14//!
15//! Enable `dashboard-host` for official Dashboard live/cache APIs,
16//! `ic-state-host` for certified IC state-tree reports,
17//! `cloud-engine-host` for native CloudEngine control-plane reports (combine it
18//! with `subnet-catalog-host` for the Registry-backed CloudEngine list),
19//! `icrc-host` for native ICRC ledger/index APIs, `sns-host` for explicitly targeted Governance neuron
20//! live/cache APIs, `cmc-host` for certified Cycles Minting Canister reports,
21//! `subnet-catalog-host` for the focused live/cache Subnet catalog API,
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 = "cmc-host",
56    feature = "icrc-host",
57    feature = "nns-host",
58    feature = "sns-host"
59))]
60mod candid_call;
61#[cfg(any(
62    test,
63    all(feature = "canister", target_arch = "wasm32"),
64    feature = "cloud-engine-host",
65    feature = "cmc-host",
66    feature = "icrc-host",
67    feature = "sns-host",
68    feature = "subnet-catalog-host"
69))]
70mod candid_decode;
71#[cfg(feature = "certificate-host")]
72pub mod certificate;
73#[cfg(any(
74    feature = "nns-host",
75    feature = "cmc-host",
76    feature = "ic-state-host",
77    feature = "icrc-host"
78))]
79mod certification;
80pub mod cloud_engine;
81#[cfg(any(
82    feature = "cloud-engine-host",
83    feature = "dashboard-host",
84    feature = "icrc-host"
85))]
86mod decimal;
87#[cfg(any(feature = "icrc-host", feature = "subnet-catalog-host"))]
88mod freshness;
89mod hex;
90mod http_endpoint;
91pub mod ic;
92#[cfg(feature = "subnet-catalog-host")]
93mod ic_registry;
94pub mod icrc;
95mod identifier_match;
96#[cfg(any(
97    feature = "cloud-engine-host",
98    feature = "cmc-host",
99    feature = "dashboard-host",
100    feature = "sns-host",
101    feature = "subnet-catalog-host"
102))]
103mod network;
104pub mod nns;
105mod principal_text;
106#[cfg(any(
107    feature = "dashboard-host",
108    feature = "icrc-host",
109    feature = "nns-host",
110    feature = "sns-host",
111    feature = "subnet-catalog-host"
112))]
113mod progress;
114pub mod report;
115mod report_sort;
116#[cfg(any(
117    feature = "dashboard-host",
118    feature = "icrc-host",
119    feature = "nns-host",
120    feature = "sns-host"
121))]
122pub(crate) mod snapshot_cache;
123pub mod sns;
124pub mod subnet_catalog;
125pub mod system;
126
127#[cfg(any(
128    feature = "dashboard-host",
129    feature = "icrc-host",
130    feature = "sns-host",
131    feature = "subnet-catalog-host"
132))]
133pub use cache_file::{CacheFileError, HostCacheError};
134mod text_search;
135
136#[cfg(all(
137    test,
138    any(
139        feature = "dashboard-host",
140        feature = "icrc-host",
141        feature = "sns-host",
142        feature = "subnet-catalog-host"
143    )
144))]
145mod tests;
146
147#[cfg(any(
148    feature = "dashboard-host",
149    feature = "icrc-host",
150    feature = "nns-host",
151    feature = "sns-host",
152    feature = "subnet-catalog-host"
153))]
154pub use progress::{
155    PagedQueryProgress, QueryProgress, QueryProgressCollection, QueryProgressEvent,
156    QueryProgressState,
157};