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