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
sourceimpl<'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
sourceimpl<'a> Clone for CompactContractRef<'a>
impl<'a> Clone for CompactContractRef<'a>
sourcefn clone(&self) -> CompactContractRef<'a>
fn clone(&self) -> CompactContractRef<'a>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for CompactContractRef<'a>
impl<'a> Debug for CompactContractRef<'a>
sourceimpl<'a> From<&'a Contract> for CompactContractRef<'a>
impl<'a> From<&'a Contract> for CompactContractRef<'a>
sourceimpl<'a> From<CompactContractRef<'a>> for CompactContract
impl<'a> From<CompactContractRef<'a>> for CompactContract
sourcefn from(c: CompactContractRef<'a>) -> Self
fn from(c: CompactContractRef<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> Serialize for CompactContractRef<'a>
impl<'a> Serialize for CompactContractRef<'a>
sourceimpl<'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.
sourcefn try_from(value: CompactContractRef<'a>) -> Result<Self, Self::Error>
fn try_from(value: CompactContractRef<'a>) -> Result<Self, Self::Error>
Performs the conversion.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more