pub struct Subscription { /* private fields */ }Expand description
Managed orderbook stream with snapshot prefetch and sequence-checked deltas.
Delivery contract: a full consumer queue fails the subscription with
Error::QueueOverflow instead of silently dropping books.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn updates(&mut self) -> &mut Receiver<OrderbookData>
pub fn updates(&mut self) -> &mut Receiver<OrderbookData>
Receiver for merged orderbook snapshots.
Sourcepub fn err(&self) -> Option<Error>
pub fn err(&self) -> Option<Error>
Terminal subscription error, if the stream failed (e.g. queue overflow).
Sourcepub fn set_on_error<F>(&self, callback: F)
pub fn set_on_error<F>(&self, callback: F)
Register a callback for background transport, decode, snapshot, or terminal buffering errors.
Sourcepub fn set_bucket(&self, bucket: &str) -> Result<()>
pub fn set_bucket(&self, bucket: &str) -> Result<()>
Change the active price bucket and re-emit the current book.
Sourcepub async fn refresh_snapshot(&self) -> Result<()>
pub async fn refresh_snapshot(&self) -> Result<()>
Refetch the REST snapshot.
Trait Implementations§
Source§impl Drop for Subscription
impl Drop for Subscription
Auto Trait Implementations§
impl !RefUnwindSafe for Subscription
impl !UnwindSafe for Subscription
impl Freeze for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
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