Skip to main content

AdvancedClient

Struct AdvancedClient 

Source
pub struct AdvancedClient<'a> { /* private fields */ }
Expand description

Low-level escape hatch for replay tools, custom transports, and diagnostics.

The primary API is exposed directly on BatMarkets. Use advanced() only when an integration needs raw lane events, fixture ingestion, command response classification, manual reconciliation, diagnostics, or venue-specific native adapter access.

Implementations§

Source§

impl<'a> AdvancedClient<'a>

Source

pub fn ingest_public_json(&self, payload: &str) -> Result<Vec<PublicLaneEvent>>

Decode a venue public websocket payload and merge its events into state.

Source

pub fn ingest_private_json( &self, payload: &str, ) -> Result<Vec<PrivateLaneEvent>>

Decode a venue private websocket payload and merge its events into state.

Source

pub fn subscribe_public_events(&self) -> Receiver<PublicLaneEvent>

Subscribe to raw public-lane events emitted by ingest or live runtime.

Source

pub fn subscribe_private_events(&self) -> Receiver<PrivateLaneEvent>

Subscribe to raw private-lane events emitted by ingest or live runtime.

Source

pub fn subscribe_command_events(&self) -> Receiver<CommandLaneEvent>

Subscribe to raw command-lane lifecycle and receipt events.

Source

pub fn subscribe_health_notifications(&self) -> Receiver<HealthNotification>

Subscribe to transition-style health notifications.

Notifications are emitted for structural runtime changes, not for every market-data tick. Most applications should prefer BatMarkets::watch_status.

Source

pub fn require_instrument( &self, instrument_id: &InstrumentId, ) -> Result<InstrumentSpec>

Return metadata for a known instrument or an Unsupported error.

Source

pub fn cached_ticker(&self, instrument_id: &InstrumentId) -> Option<Ticker>

Return the latest cached ticker for an instrument.

Source

pub fn cached_recent_trades( &self, instrument_id: &InstrumentId, ) -> Option<Vec<TradeTick>>

Return cached recent public trades for an instrument.

Source

pub fn cached_book_top(&self, instrument_id: &InstrumentId) -> Option<BookTop>

Return the latest cached top-of-book snapshot for an instrument.

Source

pub fn cached_funding_rate( &self, instrument_id: &InstrumentId, ) -> Option<FundingRate>

Return the latest cached funding-rate snapshot for an instrument.

Source

pub fn cached_mark_price( &self, instrument_id: &InstrumentId, ) -> Option<MarkPrice>

Return the latest cached mark-price snapshot for an instrument.

Source

pub fn cached_open_interest( &self, instrument_id: &InstrumentId, ) -> Option<OpenInterest>

Return the latest cached open-interest snapshot for an instrument.

Source

pub fn cached_liquidations( &self, instrument_id: &InstrumentId, ) -> Option<Vec<Liquidation>>

Return cached liquidation events for an instrument.

Source

pub fn cached_balances(&self) -> Vec<Balance>

Return cached balances from the private state projection.

Source

pub fn cached_account_summary(&self) -> Option<AccountSummary>

Return the cached account summary, if one has been observed or fetched.

Source

pub fn cached_positions(&self) -> Vec<Position>

Return cached positions from the private state projection.

Source

pub fn cached_orders(&self) -> Vec<Order>

Return all cached orders known to the engine state.

Source

pub fn cached_open_orders(&self) -> Vec<Order>

Return cached orders that are currently open.

Source

pub fn cached_executions(&self) -> Vec<Execution>

Return cached private execution fills known to the engine state.

Source

pub fn classify_command_json( &self, operation: CommandOperation, payload: Option<&str>, request_id: Option<RequestId>, ) -> Result<CommandReceipt>

Classify a raw command response payload and apply the resulting state hint.

This hook is intended for custom transports. Normal write flows should use root command methods such as BatMarkets::create_order.

Source

pub async fn reconcile(&self) -> Result<ReconcileReport>

Run a manual REST-backed private-state reconciliation pass.

Source

pub fn diagnostics(&self) -> RuntimeDiagnosticsSnapshot

Return local runtime and state-lock diagnostics.

Source

pub fn native(&self) -> NativeClient<'_>

Access venue-specific adapter functionality.

Auto Trait Implementations§

§

impl<'a> Freeze for AdvancedClient<'a>

§

impl<'a> !RefUnwindSafe for AdvancedClient<'a>

§

impl<'a> Send for AdvancedClient<'a>

§

impl<'a> Sync for AdvancedClient<'a>

§

impl<'a> Unpin for AdvancedClient<'a>

§

impl<'a> UnsafeUnpin for AdvancedClient<'a>

§

impl<'a> !UnwindSafe for AdvancedClient<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more