pub struct DepthStream { /* private fields */ }Expand description
Stream of the depth of the market of one symbol.
Implementations§
Source§impl DepthStream
impl DepthStream
Sourcepub async fn next(&mut self) -> Result<&Book, ConnectorError>
pub async fn next(&mut self) -> Result<&Book, ConnectorError>
Waits for the next change and returns the book after it.
The wait has no deadline of its own: a market may stand still. The session notices a server that has gone silent and ends the wait with an error.
§Errors
Returns ConnectorError::Transport when the connection is lost, after which the
stream goes on from an empty book once the session is logged on again, or when the
session ends, ConnectorError::Closed when it has ended before,
ConnectorError::Lagged when the reader fell behind, and ConnectorError::Fix
when the server refuses the subscription. After changes were skipped the book is no
longer that of the server; the subscription has to be opened anew.
Sourcepub async fn unsubscribe(self) -> Result<(), ConnectorError>
pub async fn unsubscribe(self) -> Result<(), ConnectorError>
Ends the subscription.
§Errors
Returns ConnectorError::Transport when the request cannot be written and
ConnectorError::Closed when the session has ended already.