dcl_crypto

Trait Web3Transport

pub trait Web3Transport: Debug + Clone {
    type Out: Future<Output = Result<Value, Error>>;

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

    // Provided method
    fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out { ... }
}
Expand description

Transport implementation

Required Associated Types§

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

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

Required Methods§

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

Prepare serializable RPC call for given method with parameters.

fn send(&self, id: usize, request: Call) -> Self::Out

Execute prepared RPC call.

Provided Methods§

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

Execute remote method with given parameters.

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§

Source§

impl Transport for WithoutTransport

Source§

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

§

impl Transport for Http

§

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

§

impl Transport for Ipc

§

type Out = SingleResponse

§

impl Transport for WebSocket

§

type Out = Response<Value, fn(_: Result<Vec<Result<Value, Error>>, Error>) -> Result<Value, Error>>

§

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

§

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

§

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

§

type Out = SingleResult

§

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

§

type Out = <T as Transport>::Out