Struct ethcontract::contract::ViewMethodBuilder [−][src]
#[must_use = "view methods do nothing unless you `.call()` them"]pub struct ViewMethodBuilder<T: Transport, R: Tokenize> { pub m: MethodBuilder<T, R>, pub block: Option<BlockId>, }
Expand description
Data used for building a contract method call. The view method builder can’t directly send transactions and is for read only method calls.
Fields
m: MethodBuilder<T, R>
method parameters
block: Option<BlockId>
optional block number
Implementations
Create a new ViewMethodBuilder
by demoting a MethodBuilder
.
Apply method defaults to this builder.
Specify the account the transaction is being sent from.
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.
Call a contract method. Contract calls do not modify the blockchain and as such do not require gas or signing.
pub fn batch_call<B: BatchTransport>(
self,
batch: &mut CallBatch<B>
) -> impl Future<Output = Result<R, MethodError>>
[src]
pub fn batch_call<B: BatchTransport>(
self,
batch: &mut CallBatch<B>
) -> impl Future<Output = Result<R, MethodError>>
[src]Adds this view method to a batch. Allows execution with other contract calls in one roundtrip
The returned future only resolve once batch
is resolved. Panics, if batch
is dropped before
executing
Trait Implementations
Auto Trait Implementations
impl<T, R> RefUnwindSafe for ViewMethodBuilder<T, R> where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R> Send for ViewMethodBuilder<T, R> where
R: Send,
T: Send,
impl<T, R> Sync for ViewMethodBuilder<T, R> where
R: Sync,
T: Sync,
impl<T, R> Unpin for ViewMethodBuilder<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for ViewMethodBuilder<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