pub struct TwapStream { /* private fields */ }Expand description
One sequenced wallet-scoped TWAP progress stream for one market. The
first event is the snapshot; later events are twap_update, heartbeat, or
recovery snapshots on the same stream identity. Any identity or sequence
mismatch fails closed so the caller reconnects and recovers from a fresh
snapshot.
Implementations§
Source§impl TwapStream
impl TwapStream
pub fn market_id(&self) -> &str
pub fn wallet_address(&self) -> &str
Sourcepub async fn next_event(
&mut self,
) -> Result<Option<PlatformTwapEvent>, SdkError>
pub async fn next_event( &mut self, ) -> Result<Option<PlatformTwapEvent>, SdkError>
Receive and validate the next event. Ok(None) means the peer closed
cleanly. Callers should reconnect after any error or close.
pub async fn close(&mut self) -> Result<(), SdkError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TwapStream
impl !RefUnwindSafe for TwapStream
impl !UnwindSafe for TwapStream
impl Send for TwapStream
impl Sync for TwapStream
impl Unpin for TwapStream
impl UnsafeUnpin for TwapStream
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