pub struct BetfairRaceStreamClient { /* private fields */ }Expand description
Betfair race stream client for Total Performance Data (TPD).
Connects to sports-data-stream-api.betfair.com and subscribes to Race Change
Messages (RCM) with live GPS tracking data. Simpler than BetfairStreamClient:
no clk-based delta resumption, just auth + raceSubscription on (re)connect.
Implementations§
Source§impl BetfairRaceStreamClient
impl BetfairRaceStreamClient
Sourcepub async fn connect(
credential: &BetfairCredential,
session_token: String,
handler: TcpMessageHandler,
config: BetfairStreamConfig,
race_fatal_tx: UnboundedSender<()>,
) -> Result<Self, BetfairStreamError>
pub async fn connect( credential: &BetfairCredential, session_token: String, handler: TcpMessageHandler, config: BetfairStreamConfig, race_fatal_tx: UnboundedSender<()>, ) -> Result<Self, BetfairStreamError>
Connects to the Betfair race stream and subscribes.
The race_fatal_tx channel receives a signal when the server returns a
fatal status error (e.g. NOT_AUTHORIZED, no TPD entitlement). The caller
should monitor this channel and close the client when it fires.
§Errors
Returns an error if the connection fails or the initial send fails.
Sourcepub fn update_auth(&self, app_key: &str, session_token: String)
pub fn update_auth(&self, app_key: &str, session_token: String)
Pushes refreshed auth bytes so the next reconnection uses the current session token instead of the one from initial connect.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BetfairRaceStreamClient
impl RefUnwindSafe for BetfairRaceStreamClient
impl Send for BetfairRaceStreamClient
impl Sync for BetfairRaceStreamClient
impl Unpin for BetfairRaceStreamClient
impl UnsafeUnpin for BetfairRaceStreamClient
impl UnwindSafe for BetfairRaceStreamClient
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more