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;
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 = "dashboard-host",
101    feature = "icrc-host",
102    feature = "nns-host",
103    feature = "sns-host"
104))]
105pub(crate) mod snapshot_cache;
106pub mod sns;
107pub mod subnet_catalog;
108pub mod system;
109
110#[cfg(any(
111    feature = "dashboard-host",
112    feature = "icrc-host",
113    feature = "sns-host",
114    feature = "subnet-catalog-host"
115))]
116pub use cache_file::{CacheFileError, HostCacheError};
117mod table;
118mod text_search;
119mod text_value;
120mod token_amount;
121mod token_metadata_text;
122
123#[cfg(all(
124    test,
125    any(
126        feature = "dashboard-host",
127        feature = "icrc-host",
128        feature = "sns-host",
129        feature = "subnet-catalog-host"
130    )
131))]
132mod test_support;
133
134#[cfg(test)]
135mod tests;
136
137#[cfg(any(
138    feature = "dashboard-host",
139    feature = "icrc-host",
140    feature = "nns-host",
141    feature = "sns-host",
142    feature = "subnet-catalog-host"
143))]
144pub use progress::{QueryProgress, QueryProgressEvent, QueryProgressState};