-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(common): make Datagram generic over payload type
Previously the payload type of `Datagram` was `Vec<u8>`, thus the `Datagram` always owned the UDP datagram payload. This change enables `Datagram` to represent both (a) an owned payload allocation (i.e. `Vec<u8>`), but also represent (b) a view into an existing payload (e.g. a long lived receive buffer via `&[u8]`). The default payload type stays `Vec<u8>`, thus not breaking existing usage of `Datagram`.
- Loading branch information
Showing
2 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters