[][src]Enum ethcontract::transaction::gas_price::GasPrice

pub enum GasPrice {
    Standard,
    Scaled(f64),
    Value(U256),
}

The gas price setting to use.

Variants

Standard

The standard estimated gas price from the node, this is usually the median gas price from the last few blocks. This is the default gas price used by transactions.

Scaled(f64)

A factor of the estimated gas price from the node. GasPrice::Standard is similar to GasPrice::Scaled(1.0) but because of how the scaling is calculated, GasPrice::Scaled(1.0) can lead to some rounding errors caused by converting the estimated gas price from the node to a f64 and back.

Value(U256)

Specify a specific gas price to use for the transaction. This will cause the transaction SendFuture to not query the node for a gas price estimation.

Methods

impl GasPrice[src]

pub fn low() -> Self[src]

A low gas price. Using this may result in long confirmation times for transactions, or the transactions not being mined at all.

pub fn high() -> Self[src]

A high gas price that usually results in faster mining times. transactions, or the transactions not being mined at all.

pub fn value(&self) -> Option<U256>[src]

Returns Some(value) if the gas price is explicitly specified, None otherwise.

pub fn resolve<T: Transport>(self, web3: &Web3<T>) -> ResolveGasPriceFuture<T>[src]

Resolves the gas price into a value. Returns a future that resolves once the gas price is calculated as this may require contacting the node for gas price estimates in the case of GasPrice::Standard and GasPrice::Scaled.

pub fn resolve_for_transaction_request<T: Transport>(
    self,
    web3: &Web3<T>
) -> ResolveTransactionRequestGasPriceFuture<T>
[src]

Resolves the gas price into an Option<U256> intendend to be used by a TransactionRequest. Note that TransactionRequests gas price default to the node's estimate (i.e. GasPrice::Standard) when omitted, so this allows for a small optimization by foregoing a JSON RPC request.

Trait Implementations

impl Clone for GasPrice[src]

impl Copy for GasPrice[src]

impl Debug for GasPrice[src]

impl Default for GasPrice[src]

impl From<U256> for GasPrice[src]

impl From<i128> for GasPrice[src]

impl From<i16> for GasPrice[src]

impl From<i32> for GasPrice[src]

impl From<i64> for GasPrice[src]

impl From<i8> for GasPrice[src]

impl From<isize> for GasPrice[src]

impl From<u128> for GasPrice[src]

impl From<u16> for GasPrice[src]

impl From<u32> for GasPrice[src]

impl From<u64> for GasPrice[src]

impl From<u8> for GasPrice[src]

impl From<usize> for GasPrice[src]

impl PartialEq<GasPrice> for GasPrice[src]

impl StructuralPartialEq for GasPrice[src]

Auto Trait Implementations

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>,