pub struct SubgraphId(/* private fields */);
Expand description
A Subgraph ID is a 32-byte identifier for a subgraph.
Implementations§
source§impl SubgraphId
impl SubgraphId
sourcepub const ZERO: Self = _
pub const ZERO: Self = _
The “zero” SubgraphId
.
This is a constant value that represents the zero ID. It is equivalent to parsing a zeroed 32-byte array.
sourcepub const fn new(value: B256) -> Self
pub const fn new(value: B256) -> Self
Create a new SubgraphId
.
Trait Implementations§
source§impl AsRef<FixedBytes<32>> for SubgraphId
impl AsRef<FixedBytes<32>> for SubgraphId
source§impl Clone for SubgraphId
impl Clone for SubgraphId
source§fn clone(&self) -> SubgraphId
fn clone(&self) -> SubgraphId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SubgraphId
impl Debug for SubgraphId
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format the SubgraphId
as a debug string.
use thegraph_core::{subgraph_id, SubgraphId};
const ID: SubgraphId = subgraph_id!("DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp");
assert_eq!(format!("{:?}", ID), "SubgraphId(DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp)");
source§impl<'de> Deserialize<'de> for SubgraphId
impl<'de> Deserialize<'de> for SubgraphId
source§fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for SubgraphId
impl Display for SubgraphId
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format the SubgraphId
as a base58-encoded string.
use thegraph_core::{subgraph_id, SubgraphId};
const ID: SubgraphId = subgraph_id!("DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp");
assert_eq!(format!("{}", ID), "DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp");
source§impl From<&SubgraphId> for B256
impl From<&SubgraphId> for B256
source§fn from(id: &SubgraphId) -> Self
fn from(id: &SubgraphId) -> Self
Converts to this type from the input type.
source§impl From<FixedBytes<32>> for SubgraphId
impl From<FixedBytes<32>> for SubgraphId
source§impl From<SubgraphId> for B256
impl From<SubgraphId> for B256
source§fn from(id: SubgraphId) -> Self
fn from(id: SubgraphId) -> Self
Converts to this type from the input type.
source§impl FromStr for SubgraphId
impl FromStr for SubgraphId
source§impl Hash for SubgraphId
impl Hash for SubgraphId
source§impl Ord for SubgraphId
impl Ord for SubgraphId
source§fn cmp(&self, other: &SubgraphId) -> Ordering
fn cmp(&self, other: &SubgraphId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for SubgraphId
impl PartialEq for SubgraphId
source§impl PartialOrd for SubgraphId
impl PartialOrd for SubgraphId
source§impl Serialize for SubgraphIdwhere
Self: Display,
impl Serialize for SubgraphIdwhere
Self: Display,
impl Copy for SubgraphId
impl Eq for SubgraphId
impl StructuralPartialEq for SubgraphId
Auto Trait Implementations§
impl Freeze for SubgraphId
impl RefUnwindSafe for SubgraphId
impl Send for SubgraphId
impl Sync for SubgraphId
impl Unpin for SubgraphId
impl UnwindSafe for SubgraphId
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)