Struct snarkvm_wasm::program::ProgramID
pub struct ProgramID<N>where
N: Network,{ /* private fields */ }
Expand description
A program ID is of the form {name}.{network}
.
Implementations
impl<N> ProgramID<N>where
N: Network,
impl<N> ProgramID<N>where
N: Network,
pub fn to_address(&self) -> Result<Address<N>, Error>
pub fn to_address(&self) -> Result<Address<N>, Error>
Returns the program address for this program ID.
impl<N> ProgramID<N>where
N: Network,
impl<N> ProgramID<N>where
N: Network,
pub const fn name(&self) -> &Identifier<N>
pub const fn name(&self) -> &Identifier<N>
Returns the program name.
pub const fn network(&self) -> &Identifier<N>
pub const fn network(&self) -> &Identifier<N>
Returns the network-level domain (NLD).
Trait Implementations
impl<'de, N> Deserialize<'de> for ProgramID<N>where
N: Network,
impl<'de, N> Deserialize<'de> for ProgramID<N>where
N: Network,
fn deserialize<D>(
deserializer: D
) -> Result<ProgramID<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<ProgramID<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the program ID from a string or bytes.
impl<N> From<(Identifier<N>, Identifier<N>)> for ProgramID<N>where
N: Network,
impl<N> From<(Identifier<N>, Identifier<N>)> for ProgramID<N>where
N: Network,
fn from(_: (Identifier<N>, Identifier<N>)) -> ProgramID<N>
fn from(_: (Identifier<N>, Identifier<N>)) -> ProgramID<N>
Initializes a program ID from a name and network-level domain identifier.
impl<N> Ord for ProgramID<N>where
N: Network,
impl<N> Ord for ProgramID<N>where
N: Network,
fn cmp(&self, other: &ProgramID<N>) -> Ordering
fn cmp(&self, other: &ProgramID<N>) -> Ordering
Ordering is determined by the network first, then the program name second.
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
impl<N> PartialEq<ProgramID<N>> for ProgramID<N>where
N: PartialEq<N> + Network,
impl<N> PartialEq<ProgramID<N>> for ProgramID<N>where
N: PartialEq<N> + Network,
impl<N> PartialOrd<ProgramID<N>> for ProgramID<N>where
N: Network,
impl<N> PartialOrd<ProgramID<N>> for ProgramID<N>where
N: Network,
fn partial_cmp(&self, other: &ProgramID<N>) -> Option<Ordering>
fn partial_cmp(&self, other: &ProgramID<N>) -> Option<Ordering>
Ordering is determined by the network first, then the program name second.
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<N> Serialize for ProgramID<N>where
N: Network,
impl<N> Serialize for ProgramID<N>where
N: Network,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the program ID into string or bytes.
impl<N> ToBits for &ProgramID<N>where
N: Network,
impl<N> ToBits for &ProgramID<N>where
N: Network,
impl<N> ToBits for ProgramID<N>where
N: Network,
impl<N> ToBits for ProgramID<N>where
N: Network,
impl<N> Copy for ProgramID<N>where
N: Copy + Network,
impl<N> Eq for ProgramID<N>where
N: Eq + Network,
impl<N> StructuralEq for ProgramID<N>where
N: Network,
impl<N> StructuralPartialEq for ProgramID<N>where
N: Network,
Auto Trait Implementations
impl<N> RefUnwindSafe for ProgramID<N>where
<N as Environment>::Field: RefUnwindSafe,
impl<N> Send for ProgramID<N>
impl<N> Sync for ProgramID<N>
impl<N> Unpin for ProgramID<N>where
<N as Environment>::Field: Unpin,
impl<N> UnwindSafe for ProgramID<N>where
<N as Environment>::Field: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;