wisespace-io / binance-rs

Rust Library for the Binance API
Other
665 stars 297 forks source link

Change websocket API to use delegate with proper lifetime management #21

Closed allada closed 5 years ago

allada commented 5 years ago

Moves websocket API so the delegates are borrowed. This allows the parent to do things like, have a single unified struct implement all the API delegate interfaces and share the same struct to each API delegate. The delegate, for example, could own the WebSockets struct and mutate members or even shutdown the websocket within a callback from the websocket API.