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