Struct jsonrpsee_ws_client::client::WsClient [−][src]
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]
&'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,
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]
&'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,
Perform a request towards the server.
fn batch_request<'life0, 'async_trait, T, M, P>(
&'life0 self,
batch: Vec<(M, P)>
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>> where
T: DeserializeOwned + Default + Clone,
M: Into<String> + Send,
P: Into<Params> + Send,
T: 'async_trait,
M: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
batch: Vec<(M, P)>
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>> where
T: DeserializeOwned + Default + Clone,
M: Into<String> + Send,
P: Into<Params> + Send,
T: 'async_trait,
M: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
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]
&'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,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,