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(feature = "icrc-host", feature = "sns-host"))]
46mod candid_call;
47#[cfg(any(
48    test,
49    all(feature = "canister", target_arch = "wasm32"),
50    feature = "cloud-engine-host",
51    feature = "cmc-host",
52    feature = "icrc-host",
53    feature = "sns-host",
54    feature = "subnet-catalog-host"
55))]
56mod candid_decode;
57#[cfg(feature = "certificate-host")]
58pub mod certificate;
59#[cfg(any(
60    feature = "certified-subnet-catalog-host",
61    feature = "cmc-host",
62    feature = "ic-state-host",
63    feature = "icrc-host"
64))]
65mod certification;
66pub mod cloud_engine;
67mod decimal;
68pub mod duration;
69#[cfg(any(
70    feature = "dashboard-host",
71    feature = "icrc-host",
72    feature = "sns-host",
73    feature = "subnet-catalog-host"
74))]
75mod freshness;
76mod hex;
77mod http_endpoint;
78mod human_quantity;
79pub mod ic;
80#[cfg(feature = "subnet-catalog-host")]
81mod ic_registry;
82pub mod icrc;
83#[cfg(any(feature = "certified-subnet-catalog-host", feature = "ic-state-host"))]
84mod leb128;
85#[cfg(feature = "ledger-evidence-host")]
86pub mod ledger_evidence;
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 text_search;
125mod text_value;
126mod token_amount;
127mod token_metadata_text;
128
129#[cfg(all(
130    test,
131    any(
132        feature = "dashboard-host",
133        feature = "icrc-host",
134        feature = "sns-host",
135        feature = "subnet-catalog-host"
136    )
137))]
138mod test_support;
139
140#[cfg(test)]
141mod tests;
142
143#[cfg(any(
144    feature = "dashboard-host",
145    feature = "icrc-host",
146    feature = "nns-host",
147    feature = "sns-host",
148    feature = "subnet-catalog-host"
149))]
150pub use progress::{QueryProgress, QueryProgressEvent, QueryProgressState};