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