mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 13:51:33 +00:00
feat(request-response): add modules for json
and cbor
messages
This patch adds two modules to `libp2p::request_response`: - `cbor` - `json` Both define a `Behaviour` type-alias that comes with a `Codec` implementation which uses the respective `serde` crate to serialize and deserialize the messages. Fixes #3905. Pull-Request: #3952.
This commit is contained in:
@ -60,7 +60,7 @@ pub(crate) async fn new(
|
||||
transport,
|
||||
ComposedBehaviour {
|
||||
kademlia: Kademlia::new(peer_id, MemoryStore::new(peer_id)),
|
||||
request_response: request_response::Behaviour::new(
|
||||
request_response: request_response::Behaviour::with_codec(
|
||||
FileExchangeCodec(),
|
||||
iter::once((
|
||||
StreamProtocol::new("/file-exchange/1"),
|
||||
|
Reference in New Issue
Block a user