Module ws_client

Module ws_client 

Source
Expand description

WebSocket client module.

Provides asynchronous WebSocket connection management, subscription handling, and heartbeat maintenance for cryptocurrency exchange streaming APIs.

§Observability

This module uses the tracing crate for structured logging. Key events:

  • Connection establishment and disconnection
  • Subscription and unsubscription events with stream names
  • Message parsing failures with raw message preview (truncated)
  • Reconnection attempts and outcomes
  • Ping/pong heartbeat events

Structs§

AutoReconnectCoordinator
Automatic reconnection coordinator for WebSocket connections.
Subscription
WebSocket subscription metadata.
WsClient
Async WebSocket client for exchange streaming APIs.
WsConfig
WebSocket connection configuration.
WsStats
WebSocket connection statistics.

Enums§

WsConnectionState
WebSocket connection state.
WsEvent
WebSocket connection event types.
WsMessage
WebSocket message types for exchange communication.

Type Aliases§

WsEventCallback
Event callback function type.