#include <protobuf_message_read_writer.hpp>
|
| ProtobufMessageReadWriter (const std::shared_ptr< libp2p::basic::ReadWriter > &read_writer) |
|
template<typename MsgType > |
void | read (ReadCallback< MsgType > &&cb) const |
|
template<typename MsgType > |
void | write (const MsgType &msg, libp2p::basic::Writer::WriteCallbackFunc &&cb) const |
|
|
template<typename MsgType > |
using | ReadCallback = std::function< void(outcome::result< MsgType >)> |
|
|
std::shared_ptr< libp2p::basic::MessageReadWriter > | read_writer_ |
|
Read and write messages, encoded into protobuf with a prepended varint
Definition at line 25 of file protobuf_message_read_writer.hpp.
template<typename MsgType >
kagome::network::ProtobufMessageReadWriter::ProtobufMessageReadWriter |
( |
const std::shared_ptr< libp2p::basic::ReadWriter > & |
read_writer | ) |
|
|
inlineexplicit |
template<typename MsgType >
void kagome::network::ProtobufMessageReadWriter::read |
( |
ReadCallback< MsgType > && |
cb | ) |
const |
|
inline |
Read a Protobuf message from the channel
- Template Parameters
-
MsgType | - type of the message |
- Parameters
-
cb | to be called, when the message is read, or error happens |
Definition at line 45 of file protobuf_message_read_writer.hpp.
template<typename MsgType >
void kagome::network::ProtobufMessageReadWriter::write |
( |
const MsgType & |
msg, |
|
|
libp2p::basic::Writer::WriteCallbackFunc && |
cb |
|
) |
| const |
|
inline |
Serialize to protobuf message and write it to the channel
- Template Parameters
-
MsgType | - type of the message |
- Parameters
-
msg | to be written |
cb | to be called, when the message is written, or error happens |
Definition at line 74 of file protobuf_message_read_writer.hpp.
std::shared_ptr<libp2p::basic::MessageReadWriter> kagome::network::ProtobufMessageReadWriter::read_writer_ |
|
private |
The documentation for this class was generated from the following file: