Skip to content

Refactor deserialization to support borrowed types #2648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

kryesh
Copy link
Contributor

@kryesh kryesh commented Jun 15, 2025

No description provided.

/// A struct that wraps an `OwnedBytes` and provides a read interface that can be used to read data
/// from it while borrowing and will not invalidate references
///
/// Useful for zerocopy deserialization since references remain valid after the cursor has advanced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mention zerocopy deserialization deserialization, but below there are several methods that copy bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those were left over from when I was testing - removed all the methods that are not in use.
The only remaining one is the Read trait which is required for the legacy JSON object parser

@kryesh kryesh force-pushed the deserialize_ref2 branch from 579b2bb to 86fcfe2 Compare July 5, 2025 01:52
@kryesh kryesh marked this pull request as ready for review July 19, 2025 08:32
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.

2 participants