thegraph_core/lib.rs
1//! Rust core modules for _The Graph_ network.
2//!
3//! # Re-export of the [`alloy`] crate
4//!
5//! This crate re-exports the [`alloy`] crate, which provides essential types, traits, and macros.
6//!
7//! To avoid potential future crate version conflicts, it is recommended to use the re-exported
8//! `alloy` crate instead of adding it directly to your `Cargo.toml` file.
9//!
10//! For convenience, this crate also re-exports the features of the `alloy` crate. These features
11//! follow the naming convention `alloy-<feature>`. For example, the `alloy-signers` and
12//! `alloy-signer-local` features enable the `signers` and `signer-local` optional features of the
13//! `alloy` crate, respectively.
14//!
15//! If you need to enable an `alloy` crate feature that is not yet re-exported by this crate, you
16//! can enable the `alloy-full` feature to enable all `alloy` features.
17//!
18//! # Features
19//!
20//! The following features are available for this crate:
21//!
22//! - `attestation`: Enables the `attestation` module, which provides types and functions for
23//! attestation-related operations.
24//! - `async-graphql`: Enables support for the [`async-graphql`] crate.
25//! - `fake`: Enables the [`fake`] crate integration for generating random test data.
26//! - `serde`: Enables [`serde`] serialization and deserialization support for types in this crate.
27//! - `signed-message`: Enables the `signed_message` module, which provides types and functions for
28//! EIP-712 message signing and verification.
29//!
30//! Additionally, this crate re-exports other features from the `alloy` crate as described above.
31
32// Enable `doc_cfg` feature for `docs.rs`
33#![cfg_attr(docsrs, feature(doc_cfg))]
34
35// Re-export `alloy` crate
36pub use alloy;
37
38#[doc(inline)]
39pub use self::{
40 allocation_id::AllocationId,
41 block::BlockPointer,
42 collection_id::CollectionId,
43 deployment_id::{DeploymentId, ParseDeploymentIdError},
44 indexer_id::IndexerId,
45 proof_of_indexing::ProofOfIndexing,
46 subgraph_id::{ParseSubgraphIdError, SubgraphId},
47};
48
49mod allocation_id;
50#[cfg(feature = "attestation")]
51#[cfg_attr(docsrs, doc(cfg(feature = "attestation")))]
52pub mod attestation;
53mod block;
54mod collection_id;
55mod deployment_id;
56#[cfg(feature = "fake")]
57#[cfg_attr(docsrs, doc(cfg(feature = "fake")))]
58pub mod fake_impl;
59mod indexer_id;
60mod proof_of_indexing;
61#[cfg(feature = "signed-message")]
62#[cfg_attr(docsrs, doc(cfg(feature = "signed-message")))]
63pub mod signed_message;
64mod subgraph_id;
65
66// Export macros
67#[doc(inline)]
68pub use self::__allocation_id as allocation_id;
69#[doc(inline)]
70pub use self::__collection_id as collection_id;
71#[doc(inline)]
72pub use self::__deployment_id as deployment_id;
73#[doc(inline)]
74pub use self::__indexer_id as indexer_id;
75#[doc(inline, alias = "poi")]
76pub use self::__proof_of_indexing as proof_of_indexing;
77#[doc(inline)]
78pub use self::__subgraph_id as subgraph_id;
79// Export internal functions required by macros
80#[doc(hidden)]
81pub use self::{deployment_id::__parse_cid_v0_const, subgraph_id::__parse_subgraph_id_const};