pub struct ContractKey { /* private fields */ }
Expand description
A complete key specification, that represents a cryptographic hash that identifies the contract.
Implementations§
Source§impl ContractKey
impl ContractKey
pub fn from_params_and_code<'a>( params: impl Borrow<Parameters<'a>>, wasm_code: impl Borrow<ContractCode<'a>>, ) -> Self
Sourcepub fn from_id(instance: impl Into<String>) -> Result<Self, Error>
pub fn from_id(instance: impl Into<String>) -> Result<Self, Error>
Builds a partial ContractKey
, the contract code part is unspecified.
Sourcepub fn code_hash(&self) -> Option<&CodeHash>
pub fn code_hash(&self) -> Option<&CodeHash>
Returns the hash of the contract code only, if the key is fully specified.
Sourcepub fn encoded_code_hash(&self) -> Option<String>
pub fn encoded_code_hash(&self) -> Option<String>
Returns the encoded hash of the contract code, if the key is fully specified.
Sourcepub fn from_params(
code_hash: impl Into<String>,
parameters: Parameters<'_>,
) -> Result<Self, Error>
pub fn from_params( code_hash: impl Into<String>, parameters: Parameters<'_>, ) -> Result<Self, Error>
Returns the contract key from the encoded hash of the contract code and the given parameters.
Sourcepub fn encoded_contract_id(&self) -> String
pub fn encoded_contract_id(&self) -> String
Returns the Base58
encoded string of the ContractInstanceId
.
pub fn id(&self) -> &ContractInstanceId
Trait Implementations§
Source§impl Clone for ContractKey
impl Clone for ContractKey
Source§fn clone(&self) -> ContractKey
fn clone(&self) -> ContractKey
Returns a duplicate 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 ContractKey
impl Debug for ContractKey
Source§impl Deref for ContractKey
impl Deref for ContractKey
Source§impl<'de> Deserialize<'de> for ContractKey
impl<'de> Deserialize<'de> for ContractKey
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 ContractKey
impl Display for ContractKey
Source§impl From<ContractInstanceId> for ContractKey
impl From<ContractInstanceId> for ContractKey
Source§fn from(instance: ContractInstanceId) -> Self
fn from(instance: ContractInstanceId) -> Self
Converts to this type from the input type.
Source§impl From<ContractKey> for ContractInstanceId
impl From<ContractKey> for ContractInstanceId
Source§fn from(key: ContractKey) -> Self
fn from(key: ContractKey) -> Self
Converts to this type from the input type.
Source§impl Hash for ContractKey
impl Hash for ContractKey
Source§impl PartialEq for ContractKey
impl PartialEq for ContractKey
Source§impl Serialize for ContractKey
impl Serialize for ContractKey
impl Copy for ContractKey
impl Eq for ContractKey
Auto Trait Implementations§
impl Freeze for ContractKey
impl RefUnwindSafe for ContractKey
impl Send for ContractKey
impl Sync for ContractKey
impl Unpin for ContractKey
impl UnwindSafe for ContractKey
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