pub struct WsClient<P, A>where
A: Actor,{ /* private fields */ }
Expand description
The client to connect to a WebSocket server.
It’s a LiteTask
attached to an Actor
that recieves incoming messages and
a WsSender
instance and uses it send outgoing messages back to a server.
Implementations§
Source§impl<P, A> WsClient<P, A>where
P: Protocol,
A: Actor + InstantActionHandler<WsClientStatus<P>> + ActionHandler<WsIncoming<P::ToClient>>,
impl<P, A> WsClient<P, A>where
P: Protocol,
A: Actor + InstantActionHandler<WsClientStatus<P>> + ActionHandler<WsIncoming<P::ToClient>>,
Trait Implementations§
Source§impl<P, A> LiteTask for WsClient<P, A>where
P: Protocol,
A: Actor + InstantActionHandler<WsClientStatus<P>> + ActionHandler<WsIncoming<P::ToClient>>,
impl<P, A> LiteTask for WsClient<P, A>where
P: Protocol,
A: Actor + InstantActionHandler<WsClientStatus<P>> + ActionHandler<WsIncoming<P::ToClient>>,
Source§fn log_target(&self) -> &str
fn log_target(&self) -> &str
The log target for the
LiteTask
.Source§fn routine<'async_trait>(
self,
stop: StopReceiver,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn routine<'async_trait>(
self,
stop: StopReceiver,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Routine of the task that can contain loops.
It can taks into accout provided receiver to implement graceful interruption. Read more
Source§fn interruptable_routine<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn interruptable_routine<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Routine that can be unconditionally interrupted.
Source§fn pre_repeatable_routine<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn pre_repeatable_routine<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Called before
repeatable_routine
for initialization.
The routine will be interrupted if this method failed.Auto Trait Implementations§
impl<P, A> Freeze for WsClient<P, A>
impl<P, A> !RefUnwindSafe for WsClient<P, A>
impl<P, A> Send for WsClient<P, A>where
P: Send,
impl<P, A> Sync for WsClient<P, A>where
P: Sync,
impl<P, A> Unpin for WsClient<P, A>where
P: Unpin,
impl<P, A> !UnwindSafe for WsClient<P, A>
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