#include <scale_message_read_writer.hpp>
|
| ScaleMessageReadWriter (std::shared_ptr< libp2p::basic::MessageReadWriter > read_writer) |
|
| ScaleMessageReadWriter (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 SCALE with a prepended varint
Definition at line 21 of file scale_message_read_writer.hpp.
template<typename MsgType >
kagome::network::ScaleMessageReadWriter::ScaleMessageReadWriter |
( |
std::shared_ptr< libp2p::basic::MessageReadWriter > |
read_writer | ) |
|
|
explicit |
kagome::network::ScaleMessageReadWriter::ScaleMessageReadWriter |
( |
const std::shared_ptr< libp2p::basic::ReadWriter > & |
read_writer | ) |
|
|
explicit |
template<typename MsgType >
void kagome::network::ScaleMessageReadWriter::read |
( |
ReadCallback< MsgType > |
cb | ) |
const |
|
inline |
Read a SCALE-encoded 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 38 of file scale_message_read_writer.hpp.
template<typename MsgType >
void kagome::network::ScaleMessageReadWriter::write |
( |
const MsgType & |
msg, |
|
|
libp2p::basic::Writer::WriteCallbackFunc |
cb |
|
) |
| const |
|
inline |
SCALE-encode a 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 63 of file scale_message_read_writer.hpp.
std::shared_ptr<libp2p::basic::MessageReadWriter> kagome::network::ScaleMessageReadWriter::read_writer_ |
|
private |
The documentation for this class was generated from the following files: