Struct ethers_solc::artifacts::contract::ContractBytecode
source · [−]pub struct ContractBytecode {
pub abi: Option<Abi>,
pub bytecode: Option<Bytecode>,
pub deployed_bytecode: Option<DeployedBytecode>,
}Expand description
Minimal representation of a contract with a present abi and bytecode.
Unlike CompactContractSome which contains the BytecodeObject, this holds the whole
Bytecode object.
Fields
abi: Option<Abi>The Ethereum Contract ABI. If empty, it is represented as an empty array. See https://docs.soliditylang.org/en/develop/abi-spec.html
bytecode: Option<Bytecode>deployed_bytecode: Option<DeployedBytecode>Implementations
sourceimpl ContractBytecode
impl ContractBytecode
sourcepub fn unwrap(self) -> ContractBytecodeSome
pub fn unwrap(self) -> ContractBytecodeSome
Returns the ContractBytecodeSome if all fields are Some
Panics
Panics if any of the fields equal None
Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let mut output = project.compile().unwrap().output();
let contract: ContractBytecode = output.remove_first("Greeter").unwrap().into();
let contract = contract.unwrap();Trait Implementations
sourceimpl Clone for ContractBytecode
impl Clone for ContractBytecode
sourcefn clone(&self) -> ContractBytecode
fn clone(&self) -> ContractBytecode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ContractBytecode
impl Debug for ContractBytecode
sourceimpl<'de> Deserialize<'de> for ContractBytecode
impl<'de> Deserialize<'de> for ContractBytecode
sourcefn 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
sourceimpl From<CompactContractBytecode> for ContractBytecode
impl From<CompactContractBytecode> for ContractBytecode
sourcefn from(c: CompactContractBytecode) -> Self
fn from(c: CompactContractBytecode) -> Self
Converts to this type from the input type.
sourceimpl From<Contract> for ContractBytecode
impl From<Contract> for ContractBytecode
sourceimpl From<ContractBytecode> for CompactContract
impl From<ContractBytecode> for CompactContract
sourcefn from(c: ContractBytecode) -> Self
fn from(c: ContractBytecode) -> Self
Converts to this type from the input type.
sourceimpl From<ContractBytecode> for CompactContractBytecode
impl From<ContractBytecode> for CompactContractBytecode
sourcefn from(c: ContractBytecode) -> Self
fn from(c: ContractBytecode) -> Self
Converts to this type from the input type.
sourceimpl From<HardhatArtifact> for ContractBytecode
impl From<HardhatArtifact> for ContractBytecode
sourcefn from(artifact: HardhatArtifact) -> Self
fn from(artifact: HardhatArtifact) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ContractBytecode> for ContractBytecode
impl PartialEq<ContractBytecode> for ContractBytecode
sourcefn eq(&self, other: &ContractBytecode) -> bool
fn eq(&self, other: &ContractBytecode) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ContractBytecode) -> bool
fn ne(&self, other: &ContractBytecode) -> bool
This method tests for !=.
sourceimpl Serialize for ContractBytecode
impl Serialize for ContractBytecode
sourceimpl TryFrom<ContractBytecode> for ContractBytecodeSome
impl TryFrom<ContractBytecode> for ContractBytecodeSome
type Error = ContractBytecode
type Error = ContractBytecode
The type returned in the event of a conversion error.
sourcefn try_from(value: ContractBytecode) -> Result<Self, Self::Error>
fn try_from(value: ContractBytecode) -> Result<Self, Self::Error>
Performs the conversion.
impl StructuralPartialEq for ContractBytecode
Auto Trait Implementations
impl RefUnwindSafe for ContractBytecode
impl Send for ContractBytecode
impl Sync for ContractBytecode
impl Unpin for ContractBytecode
impl UnwindSafe for ContractBytecode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more