pub struct BnWsStream { /* private fields */ }Implementations§
Source§impl BnWsStream
impl BnWsStream
pub async fn connect(config: ClientConfig) -> Client<Self>
Trait Implementations§
Source§impl ClientExt for BnWsStream
impl ClientExt for BnWsStream
Source§type Call = BnWsStreamCall
type Call = BnWsStreamCall
Type the custom call - parameters passed to
on_call.Source§fn on_text<'life0, 'async_trait>(
&'life0 mut self,
text: Utf8Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_text<'life0, 'async_trait>(
&'life0 mut self,
text: Utf8Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handler for text messages from the server. Read more
Source§fn on_binary<'life0, 'async_trait>(
&'life0 mut self,
_bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_binary<'life0, 'async_trait>(
&'life0 mut self,
_bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handler for binary messages from the server. Read more
Source§fn on_call<'life0, 'async_trait>(
&'life0 mut self,
call: Self::Call,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_call<'life0, 'async_trait>(
&'life0 mut self,
call: Self::Call,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handler for custom calls from other parts from your program. Read more
Source§fn on_connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called when the client successfully connected (or reconnected). Read more
Source§fn on_connect_fail<'life0, 'async_trait>(
&'life0 mut self,
_error: Error,
) -> Pin<Box<dyn Future<Output = Result<ClientCloseMode, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_connect_fail<'life0, 'async_trait>(
&'life0 mut self,
_error: Error,
) -> Pin<Box<dyn Future<Output = Result<ClientCloseMode, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Called when the client fails a connection/reconnection attempt. Read more
Source§fn on_close<'life0, 'async_trait>(
&'life0 mut self,
_frame: Option<CloseFrame>,
) -> Pin<Box<dyn Future<Output = Result<ClientCloseMode, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_close<'life0, 'async_trait>(
&'life0 mut self,
_frame: Option<CloseFrame>,
) -> Pin<Box<dyn Future<Output = Result<ClientCloseMode, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Called when the connection is closed by the server. Read more
fn get_client(&self) -> &Client<Self>
fn get_oneshot_tx_map( &mut self, ) -> &mut HashMap<String, Sender<Result<BnWsStreamResponse, SharedWsError>>>
fn send_oneshot( &mut self, payload: Payload, tx: Sender<Result<Response, SharedWsError>>, ) -> Result<(), SharedWsError>
fn recv_oneshot_resp(&mut self, text: &str) -> Option<Result<(), SharedWsError>>
fn get_stream_tx_map( &mut self, ) -> &mut HashMap<String, Sender<Result<BnWsStreamData, SharedWsError>>>
fn recv_stream_resp<'life0, 'life1, 'async_trait>(
&'life0 mut self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Result<(), SharedWsError>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for BnWsStream
impl !UnwindSafe for BnWsStream
impl Freeze for BnWsStream
impl Send for BnWsStream
impl Sync for BnWsStream
impl Unpin for BnWsStream
impl UnsafeUnpin for BnWsStream
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