Classes | |
| struct | Block |
| struct | Message |
Functions | |
| void | encode_block (Bytes &out, ByteView body) |
Append [u32 len][body] to out. | |
| Block | try_take_block (const uint8_t *data, size_t size) |
Try to take one block from the front of [data, data+size) without copying. | |
| void | encode_message (Bytes &out, FrameHeader header, ByteView payload) |
Append [type][flags][channel][payload] to out (no length prefix). | |
| Message | parse_message (ByteView inner) |
Parse an inner message from inner (header + payload). ok false if short. | |
Variables | |
| constexpr size_t | kLengthPrefixSize = 4 |
| constexpr size_t | kHeaderSize = 4 |
| type+flags+channel | |
| constexpr uint32_t | kMaxBlockSize = 64u * 1024 * 1024 |
| body cap | |
| void librats::framer::encode_block | ( | Bytes & | out, |
| ByteView | body | ||
| ) |
Append [u32 len][body] to out.
| void librats::framer::encode_message | ( | Bytes & | out, |
| FrameHeader | header, | ||
| ByteView | payload | ||
| ) |
Append [type][flags][channel][payload] to out (no length prefix).
| Message librats::framer::parse_message | ( | ByteView | inner | ) |
Parse an inner message from inner (header + payload). ok false if short.
| Block librats::framer::try_take_block | ( | const uint8_t * | data, |
| size_t | size | ||
| ) |
Try to take one block from the front of [data, data+size) without copying.
|
constexpr |
|
constexpr |