Struct ethcontract::contract::MethodBuilder [−][src]
#[must_use = "methods do nothing unless you `.call()` or `.send()` them"]pub struct MethodBuilder<T: Transport, R: Tokenize> { pub tx: TransactionBuilder<T>, // some fields omitted }
Expand description
Data used for building a contract method call or transaction. The method
builder can be demoted into a CallBuilder
to not allow sending of
transactions. This is useful when dealing with view functions.
Fields
tx: TransactionBuilder<T>
transaction parameters
Implementations
Creates a new builder for a transaction.
Apply method defaults to this builder.
Specify the signing method to use for the transaction, if not specified the the transaction will be locally signed with the default user.
Secify amount of gas to use, if not specified then a gas estimate will be used.
Specify the gas price to use, if not specified then the estimated gas price will be used.
Specify what how much ETH to transfer with the transaction, if not specified then no ETH will be sent.
Specify the nonce for the transation, if not specified will use the current transaction count for the signing account.
Specify the number of confirmations to wait for when confirming the transaction, if not specified will wait for the transaction to be mined without any extra confirmations.
Extract inner TransactionBuilder
from this SendBuilder
. This exposes
TransactionBuilder
only APIs.
Sign (if required) and send the method call transaction.
Demotes a MethodBuilder
into a ViewMethodBuilder
which has a more
restricted API and cannot actually send transactions.
Call a contract method. Contract calls do not modify the blockchain and
as such do not require gas or signing. Note that doing a call with a
block number requires first demoting the MethodBuilder
into a
ViewMethodBuilder
and setting the block number for the call.
Trait Implementations
Auto Trait Implementations
impl<T, R> RefUnwindSafe for MethodBuilder<T, R> where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R> Send for MethodBuilder<T, R> where
R: Send,
T: Send,
impl<T, R> Sync for MethodBuilder<T, R> where
R: Sync,
T: Sync,
impl<T, R> Unpin for MethodBuilder<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for MethodBuilder<T, R> where
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V