Struct ethcontract::transaction::confirm::ConfirmParams

source ·
pub struct ConfirmParams {
    pub confirmations: usize,
    pub poll_interval_min: Duration,
    pub poll_interval_max: Duration,
    pub poll_interval_factor: f32,
    pub block_timeout: Option<usize>,
}
Expand description

A struct with the confirmation parameters.

Fields§

§confirmations: usize

The number of blocks to confirm the transaction with. This is the number of blocks mined on top of the block where the transaction was mined. This means that, for example, to just wait for the transaction to be mined, then the number of confirmations should be 0. Positive non-zero values indicate that extra blocks should be waited for on top of the block where the transaction was mined.

§poll_interval_min: Duration

Minimal delay between consecutive eth_blockNumber calls. We wait for transaction confirmation by polling node for latest block number. We use exponential backoff to control how often we poll the node.

§poll_interval_max: Duration

Maximal delay between consecutive eth_blockNumber calls.

§poll_interval_factor: f32

Factor, by which the delay between consecutive eth_blockNumber calls is multiplied after each call.

§block_timeout: Option<usize>

The maximum number of blocks to wait for a transaction to get confirmed.

Implementations§

source§

impl ConfirmParams

source

pub fn mined() -> Self

Create new confirmation parameters for just confirming that the transaction was mined but not confirmed with any extra blocks.

source

pub fn with_confirmations(count: usize) -> Self

Create new confirmation parameters from the specified number of extra blocks to wait for with the default poll interval.

source

pub fn confirmations(self, confirmations: usize) -> Self

Set new value for confirmations.

source

pub fn poll_interval(self, min: Duration, max: Duration, factor: f32) -> Self

Set new values for exponential backoff settings.

source

pub fn poll_interval_min(self, poll_interval_min: Duration) -> Self

Set new value for poll_interval_min.

source

pub fn poll_interval_max(self, poll_interval_max: Duration) -> Self

Set new value for poll_interval_max.

source

pub fn poll_interval_factor(self, poll_interval_factor: f32) -> Self

Set new value for poll_interval_factor.

source

pub fn block_timeout(self, block_timeout: Option<usize>) -> Self

Set new value for block_timeout.

Trait Implementations§

source§

impl Clone for ConfirmParams

source§

fn clone(&self) -> ConfirmParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConfirmParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ConfirmParams

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more