Struct ethers_middleware::gas_oracle::GasNow
source · pub struct GasNow { /* private fields */ }Expand description
A client over HTTP for the Etherchain GasNow gas tracker API
that implements the GasOracle trait
Implementations
sourceimpl GasNow
impl GasNow
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Etherchain GasNow gas price oracle.
sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
sourcepub fn category(self, gas_category: GasCategory) -> Self
pub fn category(self, gas_category: GasCategory) -> Self
Sets the gas price category to be used when fetching the gas price.
pub async fn query(&self) -> Result<GasNowResponse, GasOracleError>
Trait Implementations
sourceimpl GasOracle for GasNow
impl GasOracle for GasNow
sourcefn fetch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn fetch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<U256, GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Makes an asynchronous HTTP query to the underlying
GasOracle Read morefn estimate_eip1559_fees<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(U256, U256), GasOracleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for GasNow
impl Send for GasNow
impl Sync for GasNow
impl Unpin for GasNow
impl !UnwindSafe for GasNow
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more