pub struct ContractMetadata {
pub source: Source,
pub contract: Contract,
pub image: Option<String>,
pub user: Option<User>,
pub abi: Map<String, Value>,
}Expand description
Smart contract metadata.
Fields§
§source: SourceInformation about the contract’s binary.
contract: ContractMetadata about the contract.
image: Option<String>If the contract is meant to be verifiable, then the Docker image is specified.
user: Option<User>Additional user-defined metadata.
abi: Map<String, Value>Raw JSON of the contract’s abi metadata, generated during contract compilation.
Implementations§
Source§impl ContractMetadata
impl ContractMetadata
Sourcepub fn new(
source: Source,
contract: Contract,
image: Option<String>,
user: Option<User>,
abi: Map<String, Value>,
) -> Self
pub fn new( source: Source, contract: Contract, image: Option<String>, user: Option<User>, abi: Map<String, Value>, ) -> Self
Construct new contract metadata.
pub fn remove_source_contract_binary_attribute(&mut self)
Sourcepub fn load<P>(metadata_path: P) -> Result<Self>
pub fn load<P>(metadata_path: P) -> Result<Self>
Reads the file and tries to parse it as instance of ContractMetadata.
Sourcepub fn check_ink_compatibility(&self) -> Result<()>
pub fn check_ink_compatibility(&self) -> Result<()>
Checks whether the contract’s ink! version is compatible with the
cargo-contract binary.
Trait Implementations§
Source§impl Clone for ContractMetadata
impl Clone for ContractMetadata
Source§fn clone(&self) -> ContractMetadata
fn clone(&self) -> ContractMetadata
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 ContractMetadata
impl Debug for ContractMetadata
Source§impl<'de> Deserialize<'de> for ContractMetadata
impl<'de> Deserialize<'de> for ContractMetadata
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
Auto Trait Implementations§
impl Freeze for ContractMetadata
impl RefUnwindSafe for ContractMetadata
impl Send for ContractMetadata
impl Sync for ContractMetadata
impl Unpin for ContractMetadata
impl UnwindSafe for ContractMetadata
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