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;
72#[cfg(any(
73    feature = "cloud-engine-host",
74    feature = "dashboard-host",
75    feature = "icrc-host",
76    feature = "sns-host"
77))]
78mod decimal;
79pub mod duration;
80#[cfg(any(
81    feature = "dashboard-host",
82    feature = "icrc-host",
83    feature = "sns-host",
84    feature = "subnet-catalog-host"
85))]
86mod freshness;
87mod hex;
88mod http_endpoint;
89mod human_quantity;
90pub mod ic;
91#[cfg(feature = "subnet-catalog-host")]
92mod ic_registry;
93pub mod icrc;
94#[cfg(any(feature = "certified-subnet-catalog-host", feature = "ic-state-host"))]
95mod leb128;
96#[cfg(feature = "ledger-evidence-host")]
97pub mod ledger_evidence;
98#[cfg(any(
99    feature = "cloud-engine-host",
100    feature = "cmc-host",
101    feature = "dashboard-host",
102    feature = "sns-host",
103    feature = "subnet-catalog-host"
104))]
105mod network;
106pub mod nns;
107mod principal_text;
108#[cfg(any(
109    feature = "dashboard-host",
110    feature = "icrc-host",
111    feature = "nns-host",
112    feature = "sns-host",
113    feature = "subnet-catalog-host"
114))]
115mod progress;
116pub mod report;
117mod report_sort;
118#[cfg(any(
119    feature = "dashboard-host",
120    feature = "icrc-host",
121    feature = "nns-host",
122    feature = "sns-host"
123))]
124pub(crate) mod snapshot_cache;
125pub mod sns;
126pub mod subnet_catalog;
127pub mod system;
128
129#[cfg(any(
130    feature = "dashboard-host",
131    feature = "icrc-host",
132    feature = "sns-host",
133    feature = "subnet-catalog-host"
134))]
135pub use cache_file::{CacheFileError, HostCacheError};
136mod text_search;
137mod text_value;
138mod token_amount;
139mod token_metadata_text;
140
141#[cfg(all(
142    test,
143    any(
144        feature = "dashboard-host",
145        feature = "icrc-host",
146        feature = "sns-host",
147        feature = "subnet-catalog-host"
148    )
149))]
150mod test_support;
151
152#[cfg(test)]
153mod tests;
154
155#[cfg(any(
156    feature = "dashboard-host",
157    feature = "icrc-host",
158    feature = "nns-host",
159    feature = "sns-host",
160    feature = "subnet-catalog-host"
161))]
162pub use progress::{QueryProgress, QueryProgressEvent, QueryProgressState};