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 deployment_id::{DeploymentId, ParseDeploymentIdError},
43 indexer_id::IndexerId,
44 proof_of_indexing::ProofOfIndexing,
45 subgraph_id::{ParseSubgraphIdError, SubgraphId},
46};
47
48mod allocation_id;
49#[cfg(feature = "attestation")]
50#[cfg_attr(docsrs, doc(cfg(feature = "attestation")))]
51pub mod attestation;
52mod block;
53mod deployment_id;
54#[cfg(feature = "fake")]
55#[cfg_attr(docsrs, doc(cfg(feature = "fake")))]
56pub mod fake_impl;
57mod indexer_id;
58mod proof_of_indexing;
59#[cfg(feature = "signed-message")]
60#[cfg_attr(docsrs, doc(cfg(feature = "signed-message")))]
61pub mod signed_message;
62mod subgraph_id;
63
64// Export macros
65#[doc(inline)]
66pub use self::__allocation_id as allocation_id;
67#[doc(inline)]
68pub use self::__deployment_id as deployment_id;
69#[doc(inline)]
70pub use self::__indexer_id as indexer_id;
71#[doc(inline, alias = "poi")]
72pub use self::__proof_of_indexing as proof_of_indexing;
73#[doc(inline)]
74pub use self::__subgraph_id as subgraph_id;
75// Export internal functions required by macros
76#[doc(hidden)]
77pub use self::{deployment_id::__parse_cid_v0_const, subgraph_id::__parse_subgraph_id_const};