Struct ethers_contract_abigen::contract::Context
source · pub struct Context { /* private fields */ }
Expand description
Internal shared context for generating smart contract bindings.
Implementations§
source§impl Context
impl Context
sourcepub fn events_declaration(&self) -> Result<TokenStream>
pub fn events_declaration(&self) -> Result<TokenStream>
Expands each event to a struct + its impl Detokenize block
sourcepub fn event_methods(&self) -> Result<TokenStream>
pub fn event_methods(&self) -> Result<TokenStream>
Generate the event filter methods for the contract
source§impl Context
impl Context
Expands a context into a method struct containing all the generated bindings to the Solidity contract methods.
sourcepub fn expand_return_struct(
&self,
function: &Function,
alias: Option<&MethodAlias>
) -> Result<TokenStream>
pub fn expand_return_struct(
&self,
function: &Function,
alias: Option<&MethodAlias>
) -> Result<TokenStream>
Expands to the corresponding struct type based on the inputs of the given function
source§impl Context
impl Context
sourcepub fn abi_structs(&self) -> Result<TokenStream>
pub fn abi_structs(&self) -> Result<TokenStream>
Generate corresponding types for structs parsed from a human readable ABI
NOTE: This assumes that all structs that are potentially used as type for variable are
in fact present in the AbiParser
, this is sound because AbiParser::parse
would have
failed already
sourcepub fn remove_struct(&mut self, name: &str)
pub fn remove_struct(&mut self, name: &str)
In the event of type conflicts this allows for removing a specific struct type.
sourcepub fn struct_definition(&mut self, name: &str) -> Result<TokenStream>
pub fn struct_definition(&mut self, name: &str) -> Result<TokenStream>
Returns the type definition for the struct with the given name
source§impl Context
impl Context
sourcepub fn expand(&self) -> Result<ExpandedContract>
pub fn expand(&self) -> Result<ExpandedContract>
Expands the whole rust contract
sourcepub fn from_abigen(args: Abigen) -> Result<Self>
pub fn from_abigen(args: Abigen) -> Result<Self>
Create a context from the code generation arguments.
sourcepub fn internal_structs(&self) -> &InternalStructs
pub fn internal_structs(&self) -> &InternalStructs
The internal abi struct mapping table
sourcepub fn internal_structs_mut(&mut self) -> &mut InternalStructs
pub fn internal_structs_mut(&mut self) -> &mut InternalStructs
The internal mutable abi struct mapping table