Struct ethers_solc::artifacts::contract::CompactContractRef
source · pub struct CompactContractRef<'a> {
pub abi: Option<&'a Abi>,
pub bin: Option<&'a BytecodeObject>,
pub bin_runtime: Option<&'a BytecodeObject>,
}
Expand description
Helper type to serialize while borrowing from Contract
Fields§
§abi: Option<&'a Abi>
§bin: Option<&'a BytecodeObject>
§bin_runtime: Option<&'a BytecodeObject>
Implementations§
source§impl<'a> CompactContractRef<'a>
impl<'a> CompactContractRef<'a>
sourcepub fn into_parts(self) -> (Option<Abi>, Option<Bytes>, Option<Bytes>)
pub fn into_parts(self) -> (Option<Abi>, Option<Bytes>, Option<Bytes>)
Clones the referenced values and returns as tuples
sourcepub fn into_parts_or_default(self) -> (Abi, Bytes, Bytes)
pub fn into_parts_or_default(self) -> (Abi, Bytes, Bytes)
Returns the individual parts of this contract.
If the values are None
, then Default
is returned.
pub fn bytecode(&self) -> Option<&Bytes>
pub fn runtime_bytecode(&self) -> Option<&Bytes>
sourcepub fn unwrap(self) -> CompactContractRefSome<'a>
pub fn unwrap(self) -> CompactContractRefSome<'a>
Returns the CompactContractRefSome
if all fields are Some
Panics
Panics if any of the fields equal None
Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let output = project.compile().unwrap().output();
let contract = output.find_first("Greeter").unwrap();
let contract = contract.unwrap();
Trait Implementations§
source§impl<'a> Clone for CompactContractRef<'a>
impl<'a> Clone for CompactContractRef<'a>
source§fn clone(&self) -> CompactContractRef<'a>
fn clone(&self) -> CompactContractRef<'a>
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<'a> Debug for CompactContractRef<'a>
impl<'a> Debug for CompactContractRef<'a>
source§impl<'a> From<&'a Contract> for CompactContractRef<'a>
impl<'a> From<&'a Contract> for CompactContractRef<'a>
source§impl<'a> From<CompactContractRef<'a>> for CompactContract
impl<'a> From<CompactContractRef<'a>> for CompactContract
source§fn from(c: CompactContractRef<'a>) -> Self
fn from(c: CompactContractRef<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Serialize for CompactContractRef<'a>
impl<'a> Serialize for CompactContractRef<'a>
source§impl<'a> TryFrom<CompactContractRef<'a>> for CompactContractRefSome<'a>
impl<'a> TryFrom<CompactContractRef<'a>> for CompactContractRefSome<'a>
§type Error = CompactContractRef<'a>
type Error = CompactContractRef<'a>
The type returned in the event of a conversion error.