Skip to content

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
Contributor

@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.

@caspermeijn
Copy link
Contributor

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