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