pub struct WebSocketClient { /* private fields */ }Expand description
WebSocket client for streaming data from Webull.
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub fn new(base_url: String, auth_manager: Arc<AuthManager>) -> Self
pub fn new(base_url: String, auth_manager: Arc<AuthManager>) -> Self
Create a new WebSocket client.
Sourcepub async fn connect(&mut self) -> WebullResult<Receiver<Event>>
pub async fn connect(&mut self) -> WebullResult<Receiver<Event>>
Connect to the WebSocket server.
Sourcepub async fn disconnect(&mut self) -> WebullResult<()>
pub async fn disconnect(&mut self) -> WebullResult<()>
Disconnect from the WebSocket server.
Sourcepub async fn subscribe(&self, request: SubscriptionRequest) -> WebullResult<()>
pub async fn subscribe(&self, request: SubscriptionRequest) -> WebullResult<()>
Subscribe to a topic.
Sourcepub async fn unsubscribe(
&self,
request: UnsubscriptionRequest,
) -> WebullResult<()>
pub async fn unsubscribe( &self, request: UnsubscriptionRequest, ) -> WebullResult<()>
Unsubscribe from a topic.
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketClient
impl !UnwindSafe for WebSocketClient
impl Freeze for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnsafeUnpin for WebSocketClient
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