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>
Source§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> Freeze for CompactContractRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more