nervosnetwork / tentacle

A multiplexed p2p network framework that supports custom protocols
https://docs.rs/tentacle
MIT License
54 stars 24 forks source link

feat: use async trait #323

Closed driftluo closed 3 years ago

driftluo commented 3 years ago

ref #305

This PR achieves a complete migration to the async trait, users can write code in async env

tentacle/src/traits.rs is the core of the modification tentacle/src/channel/bound.rs Channels adds two async methods that do not use mut to facilitate the uniformity of the user interface and avoid unnecessary mut marks tentacle/src/protocol_handle_stream.rs and tentacle/src/service.rs as the place to inherit the implementation of the user’s async trait, part of the logic is inevitably rewritten

Other changes are due to the changes caused by the above changes


This change is Reviewable