Skip to content

0.0.33

Latest
Compare
Choose a tag to compare
@HaveFunTrading HaveFunTrading released this 07 Jan 17:50
· 2 commits to main since this release

Changelog

Changes

  • [Stream] Use ConnectionInfo to simplify TCP stream creation and configuration. In addition, the ConnectionInfoProvider trait ensures cleaner stream composition API.

For example, before the change, when creating Websocket using composition we would need to reference server_name in multiple places.

let mut ws = TcpStream::bind_and_connect("stream.binance.com:9443", None, None)?
    .into_tls_stream("stream.binance.com")
    .into_websocket("wss://stream.binance.com:9443/ws");

After the change, the Websocket creation looks much simpler.

let mut ws = TcpStream::try_from(("stream.binance.com", 9443))?
    .into_tls_stream()
    .into_websocket("/ws");