[][src]Struct ethcontract::contract::MethodBuilder

#[must_use = "methods do nothing unless you `.call()` or `.send()` them"]pub struct MethodBuilder<T: Transport, R: Detokenizable> {
    pub tx: TransactionBuilder<T>,
    // some fields omitted
}

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

Methods

impl<T: Transport> MethodBuilder<T, Void>[src]

pub fn fallback(web3: Web3<T>, address: Address, data: Bytes) -> Self[src]

Creates a new builder for a transaction invoking the fallback method.

impl<T: Transport, R: Detokenizable> MethodBuilder<T, R>[src]

pub fn new(
    web3: Web3<T>,
    function: Function,
    address: Address,
    data: Bytes
) -> Self
[src]

Creates a new builder for a transaction.

pub fn with_defaults(self, defaults: &MethodDefaults) -> Self[src]

Apply method defaults to this builder.

pub fn from(self, value: Account) -> Self[src]

Specify the signing method to use for the transaction, if not specified the the transaction will be locally signed with the default user.

pub fn gas(self, value: U256) -> Self[src]

Secify amount of gas to use, if not specified then a gas estimate will be used.

pub fn gas_price(self, value: GasPrice) -> Self[src]

Specify the gas price to use, if not specified then the estimated gas price will be used.

pub fn value(self, value: U256) -> Self[src]

Specify what how much ETH to transfer with the transaction, if not specified then no ETH will be sent.

pub fn nonce(self, value: U256) -> Self[src]

Specify the nonce for the transation, if not specified will use the current transaction count for the signing account.

pub fn confirmations(self, value: usize) -> Self[src]

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.

pub fn into_inner(self) -> TransactionBuilder<T>[src]

Extract inner TransactionBuilder from this SendBuilder. This exposes TransactionBuilder only APIs.

pub fn send(self) -> MethodSendFuture<T>[src]

Sign (if required) and send the method call transaction.

pub fn view(self) -> ViewMethodBuilder<T, R>[src]

Demotes a MethodBuilder into a ViewMethodBuilder which has a more restricted API and cannot actually send transactions.

pub fn call(self) -> CallFuture<T, R>[src]

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

impl<T: Clone + Transport, R: Clone + Detokenizable> Clone for MethodBuilder<T, R>[src]

impl<T: Debug + Transport, R: Debug + Detokenizable> Debug for MethodBuilder<T, R>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,