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