pub struct WebSocketSpotStream { /* private fields */ }Implementations§
Source§impl WebSocketSpotStream
impl WebSocketSpotStream
Construct and start background task immediately.
handleris the callback for incoming events. Should be wrapped into Arc + Mutex + Box
Sourcepub fn new<Callback>(handler: Callback) -> Self
pub fn new<Callback>(handler: Callback) -> Self
Construct and start background task immediately.
handleris the callback for incoming events.
Sourcepub async fn list_subscriptions(&self) -> Result<Vec<String>>
pub async fn list_subscriptions(&self) -> Result<Vec<String>>
Subscribe to a stream
Sourcepub async fn shutdown(&self) -> Result<()>
pub async fn shutdown(&self) -> Result<()>
Ask the actor to shut down. Optionally you can await the join handle after this.
Sourcepub async fn wait_for_end(self) -> Result<()>
pub async fn wait_for_end(self) -> Result<()>
If you want, you can provide a method to wait for the actor to finish.
Auto Trait Implementations§
impl Freeze for WebSocketSpotStream
impl !RefUnwindSafe for WebSocketSpotStream
impl Send for WebSocketSpotStream
impl Sync for WebSocketSpotStream
impl Unpin for WebSocketSpotStream
impl !UnwindSafe for WebSocketSpotStream
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