[−][src]Enum ethcontract::transaction::gas_price::GasPrice
The gas price setting to use.
Variants
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.
Implementations
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 async fn resolve<T: Transport, '_>(
self,
web3: &'_ Web3<T>
) -> Result<U256, ExecutionError>
[src]
self,
web3: &'_ Web3<T>
) -> Result<U256, ExecutionError>
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 async fn resolve_for_transaction_request<T: Transport, '_>(
self,
web3: &'_ Web3<T>
) -> Result<Option<U256>, ExecutionError>
[src]
self,
web3: &'_ Web3<T>
) -> Result<Option<U256>, ExecutionError>
Resolves the gas price into an Option<U256>
intendend to be used by a
TransactionRequest
. Note that TransactionRequest
s 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
impl RefUnwindSafe for GasPrice
impl Send for GasPrice
impl Sync for GasPrice
impl Unpin for GasPrice
impl UnwindSafe for GasPrice
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,