Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Note on compression
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed May 12, 2020
1 parent e635201 commit 9e2fe18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion text/0030-protocol-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ trait Message {
```

**Notes**:
- `size_range` returns an allowed range for the message size because some parts of some messages can be trimmed. It is
used to check if a message coming from a transport layer has a valid size. More details on compression below;
- `from_bytes`/`into_bytes` panic if incorrectly used, only the following safe TLV module should directly use them;
- `into_bytes` does not allocate a buffer because the following TLV protocol implies concatenating a header inducing
another allocation. Since this is a hot path, a slice of an already allocated buffer for both the header and payload
is expected; hence, limiting the amount of allocation to the bare minimum;
- `from_bytes`/`into_bytes` panic if incorrectly used, only the following safe TLV module should directly use them;

## Type-length-value protocol

Expand Down

0 comments on commit 9e2fe18

Please sign in to comment.