Struct aleo_rust::snarkvm_types::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> 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 · 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
§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 · source§fn 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 more§impl<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,
§fn to_bits_le(&self) -> Vec<bool, Global>
fn to_bits_le(&self) -> Vec<bool, Global>
Returns the little-endian bits of the program ID.
§fn to_bits_be(&self) -> Vec<bool, Global>
fn to_bits_be(&self) -> Vec<bool, Global>
Returns the big-endian bits of the program ID.
§impl<N> ToBits for ProgramID<N>where
N: Network,
impl<N> ToBits for ProgramID<N>where N: Network,
§fn to_bits_le(&self) -> Vec<bool, Global>
fn to_bits_le(&self) -> Vec<bool, Global>
Returns the little-endian bits of the program ID.
§fn to_bits_be(&self) -> Vec<bool, Global>
fn to_bits_be(&self) -> Vec<bool, Global>
Returns the big-endian bits of the program ID.
§impl<N> TryFrom<(Identifier<N>, Identifier<N>)> for ProgramID<N>where
N: Network,
impl<N> TryFrom<(Identifier<N>, Identifier<N>)> for ProgramID<N>where N: Network,
§fn try_from(_: (Identifier<N>, Identifier<N>)) -> Result<ProgramID<N>, Error>
fn try_from(_: (Identifier<N>, Identifier<N>)) -> Result<ProgramID<N>, Error>
Initializes a program ID from a name and network-level domain identifier.
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§
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
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.