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 = "certificate-host",
39    feature = "cloud-engine-host",
40    feature = "cmc-host",
41    feature = "ic-state-host",
42    feature = "icrc-host",
43    feature = "sns-host",
44    feature = "subnet-catalog-host"
45))]
46mod agent_principal;
47#[cfg(any(
48    feature = "cloud-engine-host",
49    feature = "cmc-host",
50    feature = "icrc-host",
51    feature = "sns-host",
52    feature = "subnet-catalog-host"
53))]
54mod agent_transport;
55pub mod cache;
56#[cfg(any(
57    feature = "dashboard-host",
58    feature = "icrc-host",
59    feature = "sns-host",
60    feature = "subnet-catalog-host"
61))]
62mod cache_file;
63#[cfg(any(
64    feature = "cloud-engine-host",
65    feature = "cmc-host",
66    feature = "icrc-host",
67    feature = "nns-host",
68    feature = "sns-host"
69))]
70mod candid_call;
71#[cfg(any(
72    test,
73    all(feature = "canister", target_arch = "wasm32"),
74    feature = "cloud-engine-host",
75    feature = "cmc-host",
76    feature = "icrc-host",
77    feature = "sns-host",
78    feature = "subnet-catalog-host"
79))]
80mod candid_codec;
81#[cfg(feature = "certificate-host")]
82pub mod certificate;
83#[cfg(any(
84    feature = "nns-host",
85    feature = "cmc-host",
86    feature = "ic-state-host",
87    feature = "icrc-host"
88))]
89mod certification;
90pub mod cloud_engine;
91#[cfg(any(
92    feature = "cloud-engine-host",
93    feature = "dashboard-host",
94    feature = "icrc-host"
95))]
96mod decimal;
97#[cfg(any(feature = "icrc-host", feature = "subnet-catalog-host"))]
98mod freshness;
99mod hex;
100mod http_endpoint;
101pub mod ic;
102#[cfg(feature = "subnet-catalog-host")]
103mod ic_registry;
104pub mod icrc;
105mod identifier_match;
106#[cfg(any(
107    feature = "cloud-engine-host",
108    feature = "cmc-host",
109    feature = "dashboard-host",
110    feature = "sns-host",
111    feature = "subnet-catalog-host"
112))]
113mod network;
114pub mod nns;
115mod principal_text;
116#[cfg(any(
117    feature = "dashboard-host",
118    feature = "icrc-host",
119    feature = "nns-host",
120    feature = "sns-host",
121    feature = "subnet-catalog-host"
122))]
123mod progress;
124pub mod report;
125mod report_sort;
126#[cfg(any(
127    feature = "dashboard-host",
128    feature = "icrc-host",
129    feature = "nns-host",
130    feature = "sns-host"
131))]
132pub(crate) mod snapshot_cache;
133pub mod sns;
134pub mod subnet_catalog;
135pub mod system;
136
137#[cfg(any(
138    feature = "dashboard-host",
139    feature = "icrc-host",
140    feature = "sns-host",
141    feature = "subnet-catalog-host"
142))]
143pub use cache_file::{CacheFileError, HostCacheError};
144mod text_search;
145
146#[cfg(all(
147    test,
148    any(
149        feature = "dashboard-host",
150        feature = "icrc-host",
151        feature = "sns-host",
152        feature = "subnet-catalog-host"
153    )
154))]
155mod tests;
156
157#[cfg(any(
158    feature = "dashboard-host",
159    feature = "icrc-host",
160    feature = "nns-host",
161    feature = "sns-host",
162    feature = "subnet-catalog-host"
163))]
164pub use progress::{
165    PagedQueryProgress, QueryProgress, QueryProgressCollection, QueryProgressEvent,
166    QueryProgressState,
167};