Skip to main content

Module websocket

Module websocket 

Source
Expand description

§WebSocket Framework — Wave 0 Foundation

Replaces duplicated per-exchange connect/ping/reconnect/dispatch loops with a single generic UniversalWsTransport<P: WsProtocol>.

Each exchange shrinks to a thin declarative shim (WsProtocol impl) providing:

  • Endpoint URL
  • Ping frame
  • Subscribe/unsubscribe frames
  • Topic extractor
  • TopicRegistry mapping topic → parser

The framework owns ALL connection lifecycle, ping scheduling, subscription replay, frame routing, and unmatched-frame logging. Silent drops are architecturally impossible: unmatched topic → tracing::warn!, never Ok(None).

Re-exports§

pub use capability_provider::CapabilityProvider;
pub use protocol::WsProtocol;
pub use reconnect::ReconnectConfig;
pub use stream_kind::KlineInterval;
pub use stream_kind::StreamKind;
pub use stream_spec::StreamSpec;
pub use support_level::SupportLevel;
pub use topic_registry::ParserFn;
pub use topic_registry::RegistryEntry;
pub use topic_registry::RegistryKey;
pub use topic_registry::TopicKey;
pub use topic_registry::TopicPattern;
pub use topic_registry::TopicRegistry;
pub use topic_registry::TopicRegistryBuilder;
pub use topic_registry::topic_pattern_matches;
pub use transport::UniversalWsTransport;
pub use transport::decode_binary_default;

Modules§

capability_provider
CapabilityProvider trait — query a connector’s WebSocket stream capabilities.
protocol
WsProtocol trait — per-exchange protocol shim.
reconnect
ReconnectConfig + BackoffState — reconnect backoff logic.
stream_kind
StreamKind — typed enumeration of all known WebSocket stream kinds.
stream_spec
StreamSpec — internal subscription specification for UniversalWsTransport.
support_level
SupportLevel — describes what level of support a connector has for a given stream.
topic_registry
TopicRegistry — maps (StreamKind, AccountType) → (TopicPattern, ParserFn).
transport
UniversalWsTransport<P: WsProtocol> — generic WebSocket transport.