pub struct OkxWsStream { /* private fields */ }Implementations§
Source§impl OkxWsStream
impl OkxWsStream
pub async fn connect(config: ClientConfig) -> Client<Self>
Trait Implementations§
Source§impl ClientExt for OkxWsStream
impl ClientExt for OkxWsStream
Source§type Call = OkxWsStreamCall
type Call = OkxWsStreamCall
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<OkxWsStreamResponse, 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<Value, Sender<Result<OkxWsStreamData, 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 OkxWsStream
impl !UnwindSafe for OkxWsStream
impl Freeze for OkxWsStream
impl Send for OkxWsStream
impl Sync for OkxWsStream
impl Unpin for OkxWsStream
impl UnsafeUnpin for OkxWsStream
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