neo3/neo_clients/rpc/
connections.rs1use std::fmt::Debug;
2
3use crate::neo_clients::ProviderError;
4use async_trait::async_trait;
5use auto_impl::auto_impl;
6use serde::{de::DeserializeOwned, Serialize};
7
8#[cfg_attr(target_arch = "wasm32", async_trait(? Send))]
9#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
10#[auto_impl(&, Box, Arc)]
11pub trait JsonRpcProvider: Debug + Send + Sync {
14 type Error: Into<ProviderError>;
16
17 async fn fetch<T, R>(&self, method: &str, params: T) -> Result<R, Self::Error>
19 where
20 T: Debug + Serialize + Send + Sync,
21 R: DeserializeOwned + Send;
22}