binance_core/websocket/
controller.rs1pub trait WebSocketController {
2 type Command;
3 type Error;
4 type Response;
5 type State;
6
7 fn get_response(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send;
8
9 fn get_state(&mut self) -> impl Future<Output = Result<Self::State, Self::Error>> + Send;
10
11 fn send_command(
12 &mut self,
13 command: Self::Command,
14 ) -> impl Future<Output = Result<(), Self::Error>> + Send;
15
16 fn watch(
17 &self,
18 ) -> impl Future<Output = tokio::sync::watch::Receiver<Result<Self::Response, Self::Error>>> + Send;
19}