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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more