Trait TxFiller

Source
pub trait TxFiller<N: Network = Ethereum>:
    Clone
    + Send
    + Sync
    + Debug {
    type Fillable: Send + Sync + 'static;

    // Required methods
    fn status(&self, tx: &N::TransactionRequest) -> FillerControlFlow;
    fn fill_sync(&self, tx: &mut SendableTx<N>);
    fn prepare<P: Provider<N>>(
        &self,
        provider: &P,
        tx: &N::TransactionRequest,
    ) -> impl Send + Future<Output = TransportResult<Self::Fillable>>;
    fn fill(
        &self,
        fillable: Self::Fillable,
        tx: SendableTx<N>,
    ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>;

    // Provided methods
    fn join_with<T>(self, other: T) -> JoinFill<Self, T>
       where T: TxFiller<N> { ... }
    fn continue_filling(&self, tx: &SendableTx<N>) -> bool { ... }
    fn ready(&self, tx: &N::TransactionRequest) -> bool { ... }
    fn finished(&self, tx: &N::TransactionRequest) -> bool { ... }
    fn prepare_and_fill<P>(
        &self,
        provider: &P,
        tx: SendableTx<N>,
    ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>
       where P: Provider<N> { ... }
    fn prepare_call(
        &self,
        tx: &mut N::TransactionRequest,
    ) -> impl Send + Future<Output = TransportResult<()>> { ... }
    fn prepare_call_sync(
        &self,
        tx: &mut N::TransactionRequest,
    ) -> TransportResult<()> { ... }
}
Expand description

A layer that can fill in a TransactionRequest with additional information.

§Lifecycle Notes

The FillerControlFlow determines the lifecycle of a filler. Fillers may be in one of three states:

Required Associated Types§

Source

type Fillable: Send + Sync + 'static

The properties that this filler retrieves from the RPC. to fill in the TransactionRequest.

Required Methods§

Source

fn status(&self, tx: &N::TransactionRequest) -> FillerControlFlow

Return a control-flow enum indicating whether the filler is ready to fill in the transaction request, or if it is missing required properties.

Source

fn fill_sync(&self, tx: &mut SendableTx<N>)

Performs any synchronous filling. This should be called before TxFiller::prepare and TxFiller::fill to fill in any properties that can be filled synchronously.

Source

fn prepare<P: Provider<N>>( &self, provider: &P, tx: &N::TransactionRequest, ) -> impl Send + Future<Output = TransportResult<Self::Fillable>>

Prepares fillable properties, potentially by making an RPC request.

Source

fn fill( &self, fillable: Self::Fillable, tx: SendableTx<N>, ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>

Fills in the transaction request with the fillable properties.

Provided Methods§

Source

fn join_with<T>(self, other: T) -> JoinFill<Self, T>
where T: TxFiller<N>,

Joins this filler with another filler to compose multiple fillers.

Source

fn continue_filling(&self, tx: &SendableTx<N>) -> bool

Returns true if the filler is should continue filling.

Source

fn ready(&self, tx: &N::TransactionRequest) -> bool

Returns true if the filler is ready to fill in the transaction request.

Source

fn finished(&self, tx: &N::TransactionRequest) -> bool

Returns true if the filler is finished filling in the transaction request.

Source

fn prepare_and_fill<P>( &self, provider: &P, tx: SendableTx<N>, ) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>
where P: Provider<N>,

Prepares and fills the transaction request with the fillable properties.

Source

fn prepare_call( &self, tx: &mut N::TransactionRequest, ) -> impl Send + Future<Output = TransportResult<()>>

Prepares transaction request with necessary fillers required for eth_call operations asyncronously

Source

fn prepare_call_sync( &self, tx: &mut N::TransactionRequest, ) -> TransportResult<()>

Prepares transaction request with necessary fillers required for eth_call operations syncronously

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§