pub struct OrderSubscriber { /* private fields */ }Expand description
A wrapper around a StreamListener that allows subscribing to order updates with a somewhat
ergonomic API.
Implementations§
Source§impl OrderSubscriber
impl OrderSubscriber
pub fn new<T: MessageProcessor>( stream_api_connection: &BetfairStreamClient<T>, filter: OrderFilter, ) -> Self
Sourcepub async fn subscribe_to_strategy_updates(
&mut self,
strategy_ref: CustomerStrategyRef,
) -> Result<(), SendError<RequestMessage>>
pub async fn subscribe_to_strategy_updates( &mut self, strategy_ref: CustomerStrategyRef, ) -> Result<(), SendError<RequestMessage>>
Sourcepub async fn unsubscribe_from_strategy_updates(
&mut self,
strategy_ref: &CustomerStrategyRef,
) -> Result<(), SendError<RequestMessage>>
pub async fn unsubscribe_from_strategy_updates( &mut self, strategy_ref: &CustomerStrategyRef, ) -> Result<(), SendError<RequestMessage>>
Sourcepub async fn unsubscribe_from_all_markets(
&mut self,
) -> Result<(), SendError<RequestMessage>>
pub async fn unsubscribe_from_all_markets( &mut self, ) -> Result<(), SendError<RequestMessage>>
Unsubscribe from all markets.
Internally it uses a weird trick of subscribing to a market that does not exist to simulate unsubscribing from all markets. betfair docs
§Errors
if the message cannot be sent to the stream.
Sourcepub async fn resubscribe(&self) -> Result<(), SendError<RequestMessage>>
pub async fn resubscribe(&self) -> Result<(), SendError<RequestMessage>>
Resubscribe to the stream.
This is useful when the stream is disconnected and you want to resubscribe to the stream.
§Errors
if the stream fails to send the message
pub const fn filter(&self) -> &OrderFilter
Sourcepub async fn set_filter(
&mut self,
filter: OrderFilter,
) -> Result<(), SendError<RequestMessage>>
pub async fn set_filter( &mut self, filter: OrderFilter, ) -> Result<(), SendError<RequestMessage>>
Auto Trait Implementations§
impl Freeze for OrderSubscriber
impl RefUnwindSafe for OrderSubscriber
impl Send for OrderSubscriber
impl Sync for OrderSubscriber
impl Unpin for OrderSubscriber
impl UnwindSafe for OrderSubscriber
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