Skip to content
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

Add support for marking fields as Cow #1202

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

arilou
Copy link

@arilou arilou commented Dec 10, 2024

Add support for marking fields as Cow thus avoiding the need to own a value, this can be done on Bytes and String types only.

Copy link
Collaborator

@caspermeijn caspermeijn left a comment

Choose a reason for hiding this comment

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

I understand the need for Cow in fields. However, I think this implementation introduces more variants of the code generator and that reduces maintainability.

I am open to redoing the encoding module to make support for Cow easier. But I don't have the time to do that. I do have ideas about how to do that, so feel free to talk to me about that.

This PR is missing tests. If you can extensively prove the correct behavior (especially in combination with other Config options), I will be able to accept a feature like this.

@arilou
Copy link
Author

arilou commented Jan 5, 2025

Hi @caspermeijn,

Thank you for the feedback. I’ll focus on adding the necessary tests to this PR, particularly to verify its behavior with other Config options.

I’m also interested in your ideas for implementing Cow support more effectively. If you can share any specifics, it would help guide the implementation.

Let me know if there’s anything else you’d like addressed.

arilou added 4 commits January 7, 2025 11:58
Signed-off-by: Jon Doron <jond@wiz.io>
Signed-off-by: Jon Doron <jond@wiz.io>
Signed-off-by: Jon Doron <jond@wiz.io>
Signed-off-by: Jon Doron <jond@wiz.io>
Signed-off-by: Jon Doron <jond@wiz.io>
@caspermeijn
Copy link
Collaborator

I’m also interested in your ideas for implementing Cow support more effectively. If you can share any specifics, it would help guide the implementation.

That would be a refactor of the encoding module of prost. If you want to discuss that work, you should contact me on Discord.

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