pub struct DeploymentId(/* private fields */);Expand description
A Subgraph’s Deployment ID represents unique identifier for a deployed subgraph on The Graph.
This is the content ID of the subgraph’s manifest.
Implementations§
Source§impl DeploymentId
impl DeploymentId
Sourcepub const ZERO: Self = _
pub const ZERO: Self = _
The “zero” DeploymentId.
This is a constant value that represents the zero ID. It is equivalent to parsing a zeroed 32-byte array.
Sourcepub const fn new(bytes: B256) -> Self
pub const fn new(bytes: B256) -> Self
Create a new DeploymentId.
Trait Implementations§
Source§impl AsRef<FixedBytes<32>> for DeploymentId
impl AsRef<FixedBytes<32>> for DeploymentId
Source§impl Clone for DeploymentId
impl Clone for DeploymentId
Source§fn clone(&self) -> DeploymentId
fn clone(&self) -> DeploymentId
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 DeploymentId
impl Debug for DeploymentId
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format the DeploymentId as a debug string.
use thegraph_core::{deployment_id, DeploymentId};
const ID: DeploymentId = deployment_id!("QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY");
assert_eq!(
format!("{:?}", ID),
"DeploymentId(QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY)",
);Source§impl<'de> Deserialize<'de> for DeploymentId
impl<'de> Deserialize<'de> for DeploymentId
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 DeploymentId
impl Display for DeploymentId
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format the DeploymentId as CIDv0 (base58-encoded sha256-hash) string.
use thegraph_core::{deployment_id, DeploymentId};
const ID: DeploymentId = deployment_id!("QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY");
assert_eq!(format!("{}", ID), "QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY");Source§impl From<&DeploymentId> for B256
impl From<&DeploymentId> for B256
Source§fn from(id: &DeploymentId) -> Self
fn from(id: &DeploymentId) -> Self
Converts to this type from the input type.
Source§impl From<DeploymentId> for B256
impl From<DeploymentId> for B256
Source§fn from(id: DeploymentId) -> Self
fn from(id: DeploymentId) -> Self
Converts to this type from the input type.
Source§impl From<FixedBytes<32>> for DeploymentId
impl From<FixedBytes<32>> for DeploymentId
Source§impl FromStr for DeploymentId
impl FromStr for DeploymentId
Source§impl Hash for DeploymentId
impl Hash for DeploymentId
Source§impl InputType for DeploymentId
impl InputType for DeploymentId
Source§type RawValueType = DeploymentId
type RawValueType = DeploymentId
The raw type used for validator. Read more
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value. None represents undefined.Source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl LowerHex for DeploymentId
impl LowerHex for DeploymentId
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format the DeploymentId as a 32-byte hex string.
Note that the alternate flag, #, adds a 0x in front of the output.
use thegraph_core::{deployment_id, DeploymentId};
const ID: DeploymentId = deployment_id!("QmWmyoMoctfbAaiEs2G46gpeUmhqFRDW6KWo64y5r581Vz");
// Lower hex
assert_eq!(
format!("{:x}", ID),
"7d5a99f603f231d53a4f39d1521f98d2e8bb279cf29bebfd0687dc98458e7f89"
);
// Lower hex with alternate flag
assert_eq!(
format!("{:#x}", ID),
"0x7d5a99f603f231d53a4f39d1521f98d2e8bb279cf29bebfd0687dc98458e7f89"
);Source§impl Ord for DeploymentId
impl Ord for DeploymentId
Source§fn cmp(&self, other: &DeploymentId) -> Ordering
fn cmp(&self, other: &DeploymentId) -> 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 OutputType for DeploymentId
impl OutputType for DeploymentId
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§async fn resolve(
&self,
_: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
Resolve an output value to
async_graphql::Value.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl PartialEq for DeploymentId
impl PartialEq for DeploymentId
Source§impl PartialOrd for DeploymentId
impl PartialOrd for DeploymentId
Source§impl ScalarType for DeploymentId
impl ScalarType for DeploymentId
Source§impl Serialize for DeploymentIdwhere
Self: Display,
impl Serialize for DeploymentIdwhere
Self: Display,
impl Copy for DeploymentId
impl Eq for DeploymentId
impl StructuralPartialEq for DeploymentId
Auto Trait Implementations§
impl Freeze for DeploymentId
impl RefUnwindSafe for DeploymentId
impl Send for DeploymentId
impl Sync for DeploymentId
impl Unpin for DeploymentId
impl UnwindSafe for DeploymentId
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