Skip to content

Add checked Value::frame_len without allocating a serialized frame - #29

Open
Johny-Ivory wants to merge 1 commit into
RayforceDB:masterfrom
Johny-Ivory:feat/frame-len
Open

Johny-Ivory wants to merge 1 commit into
RayforceDB:masterfrom
Johny-Ivory:feat/frame-len

Conversation

@Johny-Ivory

Copy link
Copy Markdown

Closes #28.

Adds Value::frame_len() -> Result<usize>: the native payload size plus the bindgen-generated IPC header size, without allocating the serialized frame buffer. Conversions and addition are checked; non-positive native sizes and deferred/lazy values return errors.

The native sizing function and header use the existing deliberate-exception mechanism already used for serialization. No copied header layout or private-value-layout cast is introduced. Serialization and journal formats are unchanged.

The patch was written by Stevey and is submitted with his permission; I reviewed and tested it and am submitting under my public identity.

Validation on Rust 1.92 with this repository's pinned vendored core (0aa2d6af) and rayforce-q (69b42105):

  • cargo fmt --all -- --check: passed.
  • cargo test --offline --locked -p rayforce --test serde -- --test-threads=1: 8 passed.
  • The new equivalence test covers 15 value shapes, including empty/large strings, empty vectors/lists, dictionaries, tables and nesting.

This is focused serialization-test coverage, not a complete test-suite run or a measured speedup claim. API naming and error semantics are open to maintainer review.

Patch authored by Stevey; submitted by Johny.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the serialized IPC frame length without allocating a serialization buffer

1 participant