Skip to main content

brokapi_bybit/core/
mod.rs

1//! The sans-io cores of the Bybit connectors.
2//!
3//! A core is a state machine without sockets, tasks or clocks. It gets inbound frames and the current time, and it
4//! pushes events. The connectors in this crate run one core each ([`MdCore`] and [`UdCore`]) inside a pump task. You
5//! can also drive a core by hand, for a test or a replay of recorded frames: the trait
6//! [`brokapi_sansio::BrokerCore`] is the interface.
7//!
8//! The stream of Bybit names every data frame with its `topic` (`orderbook.50.BTCUSDT`, `order.linear`) and answers a
9//! subscription with a frame that carries the `req_id` of the request. So a core does not guess which subscription a
10//! frame is for: the connector registers the topics of each subscription ([`MdCore::register`],
11//! [`UdCore::register`]) before it sends the request, and the core looks the frame up.
12
13pub mod md;
14pub mod registry;
15pub mod ud;
16
17pub use md::MdCore;
18pub use registry::{Registry, SubState};
19pub use ud::UdCore;