RequestBuilder

Struct RequestBuilder 

Source
pub struct RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> { /* private fields */ }
Expand description

A builder to construct a Request.

To construct a RequestBuilder, refer to the EvmRpcClient documentation.

Implementations§

Source§

impl<R, C, P, Output> RequestBuilder<R, C, P, <CallRequest as EvmRpcRequest>::Config, <CallRequest as EvmRpcRequest>::Params, <CallRequest as EvmRpcRequest>::CandidOutput, Output>

Source

pub fn with_block(self, block: impl Into<BlockTag>) -> Self

Change the block parameter for an eth_call request.

Source§

impl<R, C, P, Output> RequestBuilder<R, C, P, <FeeHistoryRequest as EvmRpcRequest>::Config, <FeeHistoryRequest as EvmRpcRequest>::Params, <FeeHistoryRequest as EvmRpcRequest>::CandidOutput, Output>

Source

pub fn with_block_count(self, block_count: impl Into<Nat256>) -> Self

Change the block_count parameter for an eth_feeHistory request.

Source

pub fn with_newest_block(self, newest_block: impl Into<BlockTag>) -> Self

Change the newest_block parameter for an eth_feeHistory request.

Source

pub fn with_reward_percentiles( self, reward_percentiles: impl Into<Vec<u8>>, ) -> Self

Change the reward_percentiles parameter for an eth_feeHistory request.

Source§

impl<R, C, P, Output> RequestBuilder<R, C, P, <GetLogsRequest as EvmRpcRequest>::Config, <GetLogsRequest as EvmRpcRequest>::Params, <GetLogsRequest as EvmRpcRequest>::CandidOutput, Output>

Source

pub fn with_from_block(self, from_block: impl Into<BlockTag>) -> Self

Change the from_block parameter for an eth_getLogs request.

Source

pub fn with_to_block(self, to_block: impl Into<BlockTag>) -> Self

Change the to_block parameter for an eth_getLogs request.

Source

pub fn with_addresses(self, addresses: Vec<impl Into<Hex20>>) -> Self

Change the addresses parameter for an eth_getLogs request.

Source

pub fn with_topics(self, topics: Vec<Vec<impl Into<Hex32>>>) -> Self

Change the topics parameter for an eth_getLogs request.

Source§

impl<R, C, P, Output> RequestBuilder<R, C, P, <GetTransactionCountRequest as EvmRpcRequest>::Config, <GetTransactionCountRequest as EvmRpcRequest>::Params, <GetTransactionCountRequest as EvmRpcRequest>::CandidOutput, Output>

Source

pub fn with_address(self, address: impl Into<Hex20>) -> Self

Change the address parameter for an eth_getTransactionCount request.

Source

pub fn with_block(self, block: impl Into<BlockTag>) -> Self

Change the block parameter for an eth_getTransactionCount request.

Source§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>

Source

pub fn request_cost( self, ) -> RequestCostBuilder<Runtime, Converter, RetryPolicy, Config, Params>

Query the cycles cost for that request

Source

pub fn with_cycles(self, cycles: u128) -> Self

Change the amount of cycles to send for that request.

Source

pub fn with_params(self, params: impl Into<Params>) -> Self

Change the parameters to send for that request.

Source

pub fn modify_params<F>(self, mutator: F) -> Self
where F: FnOnce(&mut Params),

Modify current parameters to send for that request.

Source

pub fn with_rpc_config(self, rpc_config: impl Into<Config>) -> Self

Change the RPC configuration to use for that request.

Source§

impl<R: Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RequestBuilder<R, Converter, RetryPolicy, Config, Params, CandidOutput, Output>

Source

pub async fn send(self) -> Output
where Config: CandidType + Clone + Send, Params: CandidType + Clone + Send, CandidOutput: Into<Output> + CandidType + DeserializeOwned, RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,

Constructs the Request and sends it using the EvmRpcClient returning the response.

§Panics

If the request was not successful.

Source

pub async fn try_send(self) -> Result<Output, IcError>
where Config: CandidType + Clone + Send, Params: CandidType + Clone + Send, CandidOutput: Into<Output> + CandidType + DeserializeOwned, RetryPolicy: RetryPolicy<Config, Params, CandidOutput, Output> + Clone,

Constructs the Request and sends it using the EvmRpcClient. This method returns either the request response or any error that occurs while sending the request.

Source§

impl<Runtime, Converter, RetryPolicy, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, GetLogsRpcConfig, Params, CandidOutput, Output>

Source

pub fn with_max_block_range(self, max_block_range: u32) -> Self

Change the max block range error for eth_getLogs request.

Source§

impl<Runtime, Converter, RetryPolicy, Config: EvmRpcConfig + Default, Params, CandidOutput, Output> RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>

Source

pub fn with_response_size_estimate(self, response_size_estimate: u64) -> Self

Change the response size estimate to use for that request.

Source

pub fn with_response_consensus( self, response_consensus: ConsensusStrategy, ) -> Self

Change the consensus strategy to use for that request.

Trait Implementations§

Source§

impl<Runtime, Converter, RetryPolicy, Config: Clone, Params: Clone, CandidOutput, Output> Clone for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>

Source§

fn clone(&self) -> Self

Returns a duplicate 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<Runtime: Debug, Converter: Debug, RetryPolicy: Debug, Config: Debug, Params: Debug, CandidOutput, Output> Debug for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> Freeze for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: Freeze, Config: Freeze,

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> RefUnwindSafe for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: RefUnwindSafe, Config: RefUnwindSafe, CandidOutput: RefUnwindSafe, Output: RefUnwindSafe, Runtime: RefUnwindSafe, Converter: RefUnwindSafe, RetryPolicy: RefUnwindSafe,

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> Send for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: Send, Config: Send, CandidOutput: Send, Output: Send, Runtime: Sync + Send, Converter: Sync + Send, RetryPolicy: Sync + Send,

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> Sync for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: Sync, Config: Sync, CandidOutput: Sync, Output: Sync, Runtime: Sync + Send, Converter: Sync + Send, RetryPolicy: Sync + Send,

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> Unpin for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: Unpin, Config: Unpin, CandidOutput: Unpin, Output: Unpin,

§

impl<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output> UnwindSafe for RequestBuilder<Runtime, Converter, RetryPolicy, Config, Params, CandidOutput, Output>
where Params: UnwindSafe, Config: UnwindSafe, CandidOutput: UnwindSafe, Output: UnwindSafe, Runtime: RefUnwindSafe, Converter: RefUnwindSafe, RetryPolicy: RefUnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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>,

Source§

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.