Trait web3::BatchTransport

source ·
pub trait BatchTransport: Transport {
    type Batch: Future<Output = Result<Vec<Result<Value>>>>;

    // Required method
    fn send_batch<T>(&self, requests: T) -> Self::Batch
       where T: IntoIterator<Item = (RequestId, Call)>;
}
Expand description

A transport implementation supporting batch requests.

Required Associated Types§

source

type Batch: Future<Output = Result<Vec<Result<Value>>>>

The type of future this transport returns when a call is made.

Required Methods§

source

fn send_batch<T>(&self, requests: T) -> Self::Batchwhere T: IntoIterator<Item = (RequestId, Call)>,

Sends a batch of prepared RPC calls.

Implementors§

source§

impl BatchTransport for Http

§

type Batch = Pin<Box<dyn Future<Output = Result<Vec<Result<Value, Error>, Global>, Error>> + Send, Global>>

source§

impl BatchTransport for Ipc

source§

impl BatchTransport for WebSocket

source§

impl<A, B, ABatch, BBatch> BatchTransport for Either<A, B>where A: BatchTransport<Batch = ABatch>, B: BatchTransport<Batch = BBatch>, A::Out: 'static + Send, B::Out: 'static + Send, ABatch: Future<Output = Result<Vec<Result<Value>>>> + 'static + Send, BBatch: Future<Output = Result<Vec<Result<Value>>>> + 'static + Send,

§

type Batch = Pin<Box<dyn Future<Output = Result<Vec<Result<Value, Error>, Global>, Error>> + Send, Global>>

source§

impl<X, T> BatchTransport for Xwhere T: BatchTransport + ?Sized, X: Deref<Target = T> + Debug + Clone,