pub struct Client { /* private fields */ }

Implementations§

source§

impl Client

source

pub fn from_backend<S, R>(send: S, recv: R) -> (Client, ClientDriver)where S: BackendSender, R: BackendReceiver + 'static,

Construct a client/driver from a BackendSender and BackendReceiver. The ClientDriver handed back is a stream which needs polling in order to drive the message receiving.

source

pub async fn request<Res>(&self, call: Call<'_>) -> Result<Res, RequestError>where Res: DeserializeOwned,

Make a request to the RPC server. This will return either a response or an error, and will attempt to deserialize the response into the type you’ve asked for.

source

pub async fn notification(&self, call: Call<'_>) -> Result<(), BackendError>

Send a notification to the RPC server. This will not return a result.

source

pub fn incoming(&self) -> ServerNotifications

Obtain a stream of incoming notifications from the backend that aren’t linked to any specific request.

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.