pub struct PrivateStream { /* private fields */ }Expand description
A live connection to the private endpoint.
Implementations§
Source§impl PrivateStream
impl PrivateStream
Sourcepub async fn next(&mut self) -> Option<StreamMessage>
pub async fn next(&mut self) -> Option<StreamMessage>
Await the next message, or None once the stream has closed.
Sourcepub fn endpoint(&self) -> StreamEndpoint
pub fn endpoint(&self) -> StreamEndpoint
Which socket this handle is attached to.
pub fn is_shutdown(&self) -> bool
Sourcepub async fn subscribe(
&self,
subscription: PrivateSubscription,
) -> Result<(), PolymarketUsError>
pub async fn subscribe( &self, subscription: PrivateSubscription, ) -> Result<(), PolymarketUsError>
Add a subscription to the live connection.
The frame is sent immediately and replayed after every reconnect.
Sourcepub async fn unsubscribe(
&self,
request_id: &str,
) -> Result<(), PolymarketUsError>
pub async fn unsubscribe( &self, request_id: &str, ) -> Result<(), PolymarketUsError>
Cancel a subscription by the requestId it was created with.
The subscription is dropped from the reconnect list immediately
and an unsubscribe frame is sent over the live connection.
Auto Trait Implementations§
impl Freeze for PrivateStream
impl RefUnwindSafe for PrivateStream
impl Send for PrivateStream
impl Sync for PrivateStream
impl Unpin for PrivateStream
impl UnsafeUnpin for PrivateStream
impl UnwindSafe for PrivateStream
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