[][src]Struct kayrx::jrpc::client::Client

pub struct Client { /* fields omitted */ }

Client that can be cloned.

Note: This struct is designed to be easy to use, but it works by maintaining a background task running in parallel. If this is not desirable, you are encouraged to use the RawClient struct instead.

Methods

impl Client[src]

pub fn new<R>(client: RawClient<R>) -> Client where
    R: TransportClient + Send + 'static,
    R::Error: Error + Send + Sync
[src]

Initializes a new client based upon this raw client.

pub async fn notification<'_>(
    &'_ self,
    method: impl Into<String>,
    params: impl Into<Params>
)
[src]

Send a notification to the server.

pub async fn request<'_, Ret>(
    &'_ self,
    method: impl Into<String>,
    params: impl Into<Params>
) -> Result<Ret, RequestError> where
    Ret: DeserializeOwned
[src]

Perform a request towards the server.

pub async fn subscribe<'_, Notif>(
    &'_ self,
    subscribe_method: impl Into<String>,
    params: impl Into<Params>,
    unsubscribe_method: impl Into<String>
) -> Result<Subscription<Notif>, RequestError>
[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.

Trait Implementations

impl Clone for Client[src]

impl<R> From<RawClient<R>> for Client where
    R: TransportClient + Send + 'static,
    R::Error: Error + Send + Sync
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,