pub struct ManagedStream { /* private fields */ }Implementations§
Source§impl ManagedStream
impl ManagedStream
pub async fn next(&mut self) -> Option<StreamMessage>
pub fn shutdown(&self)
pub fn is_shutdown(&self) -> bool
Sourcepub async fn subscribe(
&self,
sub: StreamSubscription,
) -> Result<(), PolymarketUsError>
pub async fn subscribe( &self, sub: StreamSubscription, ) -> Result<(), PolymarketUsError>
Dynamically add a subscription to the live connection.
The subscription frame is sent immediately over the existing WebSocket and re-sent automatically after every reconnect.
Sourcepub async fn unsubscribe(
&self,
tracking_id: &str,
) -> Result<(), PolymarketUsError>
pub async fn unsubscribe( &self, tracking_id: &str, ) -> Result<(), PolymarketUsError>
Remove a subscription by its tracking_id.
The subscription is removed from the reconnect list immediately. An unsubscribe frame is also sent to the server over the live connection.
Auto Trait Implementations§
impl Freeze for ManagedStream
impl RefUnwindSafe for ManagedStream
impl Send for ManagedStream
impl Sync for ManagedStream
impl Unpin for ManagedStream
impl UnsafeUnpin for ManagedStream
impl UnwindSafe for ManagedStream
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