Struct jsonrpsee_ws_client::client::WsClient[][src]

pub struct WsClient { /* fields omitted */ }

WebSocket client that works by maintaining a background task running in parallel.

It’s possible that the background thread is terminated and this makes the client unusable. An error Error::RestartNeeded is returned if this happens and users has to manually handle dropping and restarting a new client.

Implementations

impl WsClient[src]

pub fn is_connected(&self) -> bool[src]

Checks if the client is connected to the target.

Trait Implementations

impl Client for WsClient[src]

fn notification<'life0, 'async_trait, M, P>(
    &'life0 self,
    method: M,
    params: P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    M: Into<String> + Send,
    P: Into<Params> + Send,
    M: 'async_trait,
    P: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Send a notification to the server.

fn request<'life0, 'async_trait, T, M, P>(
    &'life0 self,
    method: M,
    params: P
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>> where
    T: DeserializeOwned,
    M: Into<String> + Send,
    P: Into<Params> + Send,
    T: 'async_trait,
    M: 'async_trait,
    P: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Perform a request towards the server.

impl Debug for WsClient[src]

impl SubscriptionClient for WsClient[src]

fn subscribe<'life0, 'async_trait, SM, UM, P, N>(
    &'life0 self,
    subscribe_method: SM,
    params: P,
    unsubscribe_method: UM
) -> Pin<Box<dyn Future<Output = Result<Subscription<N>, Error>> + Send + 'async_trait>> where
    SM: Into<String> + Send,
    UM: Into<String> + Send,
    P: Into<Params> + Send,
    N: DeserializeOwned,
    SM: 'async_trait,
    UM: 'async_trait,
    P: 'async_trait,
    N: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Send a subscription request to the server.

The subscribe_method and params are used to ask for the subscription towards the server. The unsubscribe_method is used to close the subscription.

Auto Trait Implementations

impl !RefUnwindSafe for WsClient

impl Send for WsClient

impl Sync for WsClient

impl Unpin for WsClient

impl !UnwindSafe for WsClient

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,