Struct ethers_solc::artifacts::contract::CompactContractRef
source · pub struct CompactContractRef<'a> {
pub abi: Option<&'a Contract>,
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 Contract>
§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.
impl<'a> Copy for CompactContractRef<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for CompactContractRef<'a>
impl<'a> Send for CompactContractRef<'a>
impl<'a> Sync for CompactContractRef<'a>
impl<'a> Unpin for CompactContractRef<'a>
impl<'a> UnwindSafe for CompactContractRef<'a>
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