Struct aleo_rust::snarkvm_types::Locator
pub struct Locator<N>where
N: Network,{ /* private fields */ }
Expand description
A locator is of the form {program_id}/{resource}
(i.e. howard.aleo/notify
).
Implementations§
§impl<N> Locator<N>where
N: Network,
impl<N> Locator<N>where
N: Network,
pub const fn new(
program_id: ProgramID<N>,
resource: Identifier<N>
) -> Locator<N>
pub const fn new( program_id: ProgramID<N>, resource: Identifier<N> ) -> Locator<N>
Initializes a locator from a program ID and resource.
§impl<N> Locator<N>where
N: Network,
impl<N> Locator<N>where
N: Network,
pub const fn program_id(&self) -> &ProgramID<N>
pub const fn program_id(&self) -> &ProgramID<N>
Returns the program ID.
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).
pub const fn resource(&self) -> &Identifier<N>
pub const fn resource(&self) -> &Identifier<N>
Returns the resource name.
Trait Implementations§
§impl<'de, N> Deserialize<'de> for Locator<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Locator<N>where
N: Network,
§fn deserialize<D>(
deserializer: D
) -> Result<Locator<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Locator<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the locator from a string or bytes.
§impl<N> PartialEq for Locator<N>
impl<N> PartialEq for Locator<N>
§impl<N> Serialize for Locator<N>where
N: Network,
impl<N> Serialize for Locator<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 locator into string or bytes.
impl<N> Copy for Locator<N>
impl<N> Eq for Locator<N>
impl<N> StructuralPartialEq for Locator<N>where
N: Network,
Auto Trait Implementations§
impl<N> RefUnwindSafe for Locator<N>where
<N as Environment>::Field: RefUnwindSafe,
impl<N> Send for Locator<N>
impl<N> Sync for Locator<N>
impl<N> Unpin for Locator<N>where
<N as Environment>::Field: Unpin,
impl<N> UnwindSafe for Locator<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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.