[−][src]Struct kayrx::jrpc::raw::RawClient
Wraps around a TransportClient
and analyzes everything
correctly.
See the module root documentation for more information.
Methods
impl<R> RawClient<R>
[src]
impl<R> RawClient<R> where
R: TransportClient,
[src]
R: TransportClient,
pub async fn send_notification<'_>(
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<(), R::Error>
[src]
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<(), R::Error>
Sends a notification to the server. The notification doesn't need any response.
This asynchronous function finishes when the notification has finished being sent.
pub async fn start_request<'_>(
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<RawClientRequestId, R::Error>
[src]
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<RawClientRequestId, R::Error>
Starts a request.
This asynchronous function finishes when the request has been sent to the server. The
request is added to the RawClient
. You must then call next_event
until you get a response.
pub async fn start_subscription<'_>(
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<RawClientRequestId, R::Error>
[src]
&'_ mut self,
method: impl Into<String>,
params: impl Into<Params>
) -> Result<RawClientRequestId, R::Error>
Starts a request.
This asynchronous function finishes when the request has been sent to the server. The
request is added to the RawClient
. You must then call next_event
until you get a response.
pub async fn next_event<'_>(
&'_ mut self
) -> Result<RawClientEvent, RawClientError<R::Error>>
[src]
&'_ mut self
) -> Result<RawClientEvent, RawClientError<R::Error>>
Waits until the client receives a message from the server.
If this function returns an Err
, it indicates a connectivity issue with the server or a
low-level protocol error, and not a request that has failed to be answered.
pub fn request_by_id<'a>(
&'a mut self,
rq_id: RawClientRequestId
) -> Option<impl Future<Output = Result<JsonValue, RawClientError<R::Error>>> + 'a>
[src]
&'a mut self,
rq_id: RawClientRequestId
) -> Option<impl Future<Output = Result<JsonValue, RawClientError<R::Error>>> + 'a>
Returns a Future
that resolves when the server sends back a response for the given
request.
Returns None
if the request identifier is invalid, or if the request is a subscription.
Note: While this function is waiting, all the other responses and pubsub events returned by the server will be buffered up to a certain limit. Once this limit is reached, server notifications will be discarded. If you want to be sure to catch all notifications, use
next_event
instead.
pub fn subscription_by_id(
&mut self,
rq_id: RawClientRequestId
) -> Option<RawClientSubscription<R>>
[src]
&mut self,
rq_id: RawClientRequestId
) -> Option<RawClientSubscription<R>>
Returns a RawClientSubscription
object representing a certain active or pending
subscription.
Returns None
if the identifier is invalid, or if it is not a subscription.
Trait Implementations
impl<R> Debug for RawClient<R> where
R: Debug,
[src]
R: Debug,
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<R> RefUnwindSafe for RawClient<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for RawClient<R> where
R: Send,
R: Send,
impl<R> Sync for RawClient<R> where
R: Sync,
R: Sync,
impl<R> Unpin for RawClient<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for RawClient<R> where
R: UnwindSafe,
R: UnwindSafe,
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, 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>,