pub struct Client<T: Transport> { /* private fields */ }
Expand description
A client for an endpoint.
It must be actively polled to receive events and two-way message responses.
Implementations§
Source§impl<T: Transport> Client<T>
impl<T: Transport> Client<T>
Sourcepub fn sender(&self) -> &ClientSender<T>
pub fn sender(&self) -> &ClientSender<T>
Returns the sender for the client.
Sourcepub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<T::Error>>where
H: ClientHandler<T>,
pub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<T::Error>>where
H: ClientHandler<T>,
Runs the client with the provided handler.
Auto Trait Implementations§
impl<T> Freeze for Client<T>
impl<T> RefUnwindSafe for Client<T>
impl<T> Send for Client<T>
impl<T> Sync for Client<T>
impl<T> Unpin for Client<T>
impl<T> UnwindSafe for Client<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more