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:
- Missing: The filler is missing a required property to fill in the transaction request.
TxFiller::status
should returnFillerControlFlow::Missing
. with a list of the missing properties. - Ready: The filler is ready to fill in the transaction request.
TxFiller::status
should returnFillerControlFlow::Ready
. - Finished: The filler has filled in all properties that it can fill.
TxFiller::status
should returnFillerControlFlow::Finished
.
Required Associated Types§
Required Methods§
Sourcefn status(&self, tx: &N::TransactionRequest) -> FillerControlFlow
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.
Sourcefn fill_sync(&self, tx: &mut SendableTx<N>)
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.
Sourcefn prepare<P: Provider<N>>(
&self,
provider: &P,
tx: &N::TransactionRequest,
) -> impl Send + Future<Output = TransportResult<Self::Fillable>>
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.
Provided Methods§
Sourcefn join_with<T>(self, other: T) -> JoinFill<Self, T>where
T: TxFiller<N>,
fn join_with<T>(self, other: T) -> JoinFill<Self, T>where
T: TxFiller<N>,
Joins this filler with another filler to compose multiple fillers.
Sourcefn continue_filling(&self, tx: &SendableTx<N>) -> bool
fn continue_filling(&self, tx: &SendableTx<N>) -> bool
Returns true
if the filler is should continue filling.
Sourcefn ready(&self, tx: &N::TransactionRequest) -> bool
fn ready(&self, tx: &N::TransactionRequest) -> bool
Returns true
if the filler is ready to fill in the transaction request.
Sourcefn finished(&self, tx: &N::TransactionRequest) -> bool
fn finished(&self, tx: &N::TransactionRequest) -> bool
Returns true
if the filler is finished filling in the transaction request.
Sourcefn prepare_and_fill<P>(
&self,
provider: &P,
tx: SendableTx<N>,
) -> impl Send + Future<Output = TransportResult<SendableTx<N>>>where
P: Provider<N>,
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.
Sourcefn prepare_call(
&self,
tx: &mut N::TransactionRequest,
) -> impl Send + Future<Output = TransportResult<()>>
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
Sourcefn prepare_call_sync(
&self,
tx: &mut N::TransactionRequest,
) -> TransportResult<()>
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.