pub async fn subscribe<'a, T: DeserializeOwned>(
        &self,
        subscribe_method: &str,
        params: &[JsonValue],
        unsubscribe_method: &str,
    ) -> Result<Subscription<T>, Error> {
        let params = params.into();
        match self {
            Self::WebSocket(inner) => {
                inner
                    .subscribe(subscribe_method, params, unsubscribe_method)
                    .await
                    .map_err(Into::into)
            }
            Self::Http(_) => {
                Err(RpcError::Custom(
                    "Subscriptions not supported on HTTP transport".to_owned(),
                )
                .into())
            }
            #[cfg(feature = "client")]
            Self::Subxt(inner) => {
                inner
                    .subscribe(subscribe_method, params, unsubscribe_method)
                    .await
                    .map_err(Into::into)
            }
        }
    }
/// Start a JSON-RPC Subscription.
Start a JSON-RPC Subscription.
Start a JSON - RPC Subscription .
pub async fn subscribe<'a, T: DeserializeOwned>(
        &self,
        subscribe_method: &str,
        params: &[JsonValue],
        unsubscribe_method: &str,
    ) -> Result<Subscription<T>, Error> {
        let params = params.into();
        match self {
            Self::WebSocket(inner) => {
                inner
                    .subscribe(subscribe_method, params, unsubscribe_method)
                    .await
                    .map_err(Into::into)
            }
            Self::Http(_) => {
                Err(RpcError::Custom(
                    "Subscriptions not supported on HTTP transport".to_owned(),
                )
                .into())
            }
            #[cfg(feature = "client")]
            Self::Subxt(inner) => {
                inner
                    .subscribe(subscribe_method, params, unsubscribe_method)
                    .await
                    .map_err(Into::into)
            }
        }
    }
pub async fn subscribe < ' a , T : DeserializeOwned > ( & self , subscribe_method : & str , params : & [ JsonValue ] , unsubscribe_method : & str , ) -> Result < Subscription < T > , Error > { let params = params . into ( ) ; match self { Self :: WebSocket ( inner ) => { inner . subscribe ( subscribe_method , params , unsubscribe_method ) . await . map_err ( Into :: into ) } Self :: Http ( _ ) => { Err ( RpcError :: Custom ( " " . to_owned ( ) , ) . into ( ) ) } # [ cfg ( feature " " ) ] Self :: Subxt ( inner ) => { inner . subscribe ( subscribe_method , params , unsubscribe_method ) . await . map_err ( Into :: into ) } } }
Start a JSON-RPC Subscription.
Start a JSON - RPC Subscription .
&self
subscribe_method
&str
params
&[JsonValue]
unsubscribe_method
&str
&self
subscribe_method
&str
params
&[JsonValue]
unsubscribe_method
&str