[−][src]Struct kayrx::jrpc::Client
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]
R: TransportClient + Send + 'static,
R::Error: Error + Send + Sync,
Initializes a new client based upon this raw client.
pub async fn notification<'_>(
&'_ self,
method: impl Into<String>,
params: impl Into<Params>
)
[src]
&'_ self,
method: impl Into<String>,
params: impl Into<Params>
)
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]
&'_ self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<Ret, RequestError> where
Ret: DeserializeOwned,
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]
&'_ self,
subscribe_method: impl Into<String>,
params: impl Into<Params>,
unsubscribe_method: impl Into<String>
) -> Result<Subscription<Notif>, RequestError>
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]
R: TransportClient + Send + 'static,
R::Error: Error + Send + Sync,
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]
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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.
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>,