Trait ic_web3_rs::Transport

source ·
pub trait Transport: Debug + Clone {
    type Out: Future<Output = Result<Value>>;

    // Required methods
    fn prepare(&self, method: &str, params: Vec<Value>) -> (RequestId, Call);
    fn send(
        &self,
        id: RequestId,
        request: Call,
        options: CallOptions
    ) -> Self::Out;

    // Provided methods
    fn execute(
        &self,
        method: &str,
        params: Vec<Value>,
        options: CallOptions
    ) -> Self::Out { ... }
    fn set_max_response_bytes(&mut self, bytes: u64) { ... }
}
Expand description

Transport implementation

Required Associated Types§

source

type Out: Future<Output = Result<Value>>

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

Required Methods§

source

fn prepare(&self, method: &str, params: Vec<Value>) -> (RequestId, Call)

Prepare serializable RPC call for given method with parameters.

source

fn send(&self, id: RequestId, request: Call, options: CallOptions) -> Self::Out

Execute prepared RPC call.

Provided Methods§

source

fn execute( &self, method: &str, params: Vec<Value>, options: CallOptions ) -> Self::Out

Execute remote method with given parameters.

source

fn set_max_response_bytes(&mut self, bytes: u64)

set the max response bytes, do nothing by default

Implementors§

source§

impl Transport for ICHttp

§

type Out = Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'static, Global>>

source§

impl<A, B, AOut, BOut> Transport for Either<A, B>where A: Transport<Out = AOut>, B: Transport<Out = BOut>, AOut: Future<Output = Result<Value>> + 'static + Send, BOut: Future<Output = Result<Value>> + 'static + Send,

§

type Out = Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'static, Global>>

source§

impl<T> Transport for Batch<T>where T: BatchTransport,

source§

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

§

type Out = <T as Transport>::Out