feat: MessagePack WireFormat + Envelope round-trip tests (rollout step 7b) - #2
Merged
Merged
Conversation
format::MsgPack — a WireFormat over rmp-serde. encode serialises straight into the caller's BufMut via a std::io::Write adapter (no intermediate Vec); decode borrows from the input (a #[serde(borrow)] &'de str field decodes as a view into the buffer — test proves it). std-gated: rmp-serde needs std::io; a no_std msgpack path comes later. 7 unit tests: msgpack owned/borrowed round-trip, garbage → Serialization, no-realloc encode; Envelope ok/err round-trip and malformed-frame rejection. All three feature configs build; the trimmed workspace is green.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #1.
format::MsgPack— aWireFormatoverrmp-serde.encodeserialises straight into the caller'sBufMutvia astd::io::Writeadapter — no intermediateVec.decodeborrows from the input — a#[serde(borrow)] &'de strfield decodes as a view into the receive buffer (test proves it).std-gated:rmp-serde1.3 needsstd::io. Ano_stdMessagePack path (on theno_stdrmpcrate) comes later.RuntimeError::Serialization, encode-doesn't-realloc;EnvelopeOk/Errround-trip and malformed-frame rejection (empty / unknown tag / truncated id).serdederiveadded to[dev-dependencies]for the test structs.Verified
comline-runtimebuilds in all three feature configs (default /--no-default-features/--features alloc); the trimmed workspacecargo testis green (7 passed, 1 ignored — the stubbedsetup/integration test).Next (7c)
Wire
Dispatchinto a call system: a generated-dispatcher shape end to end (params → handler →Envelope→ transport), then rework the stubbedsetup/.