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