Skip to main content

QpClientCallbacks

Trait QpClientCallbacks 

Source
pub trait QpClientCallbacks:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn on_connected(&self) { ... }
    fn on_disconnected(&self, _reason: QpDisconnectReason) { ... }
    fn on_stale_messages_drained(&self, _count: u64) { ... }
    fn on_rfq_response_dropped(
        &self,
        _message: &ClientOutbound,
        _reason: RfqDropReason,
    ) { ... }
    fn on_inbound_message_dropped(&self) { ... }
    fn on_transport_activity(&self) { ... }
    fn on_write_failed(
        &self,
        _operation: QpWriteOperation,
        _failure: QpWriteFailure,
    ) { ... }
}
Expand description

Callbacks for observability hooks. Implement this to wire in your own metrics framework (Prometheus, StatsD, etc.). The default NoopCallbacks does nothing.

Provided Methods§

Source

fn on_connected(&self)

Source

fn on_disconnected(&self, _reason: QpDisconnectReason)

Source

fn on_stale_messages_drained(&self, _count: u64)

A bulk count of outbound messages discarded rather than sent. Both runtimes report through this: the legacy client counts its pre-reconnect drain, and the scoped runtime counts superseded indicative frames AND dropped RFQ responses. It carries no identity, so a firm quote that died here cannot be traced back to its rfq_id – use Self::on_rfq_response_dropped for that. The scoped runtime reports every RFQ drop through BOTH hooks, so existing consumers of this count see unchanged totals.

Source

fn on_rfq_response_dropped( &self, _message: &ClientOutbound, _reason: RfqDropReason, )

An RFQ response the scoped runtime could not deliver, with the message itself so the loss can be attributed (its rfq_id, nonce, and legs are all still present). A signed quote that never reaches the venue usually needs a corrective audit event on the same rfq_id; the bare count above cannot support that. Scoped runtime only – the legacy client has no per-message deadlines.

Source

fn on_inbound_message_dropped(&self)

Source

fn on_transport_activity(&self)

Source

fn on_write_failed( &self, _operation: QpWriteOperation, _failure: QpWriteFailure, )

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§