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

feature: Add setter for message fields #40

Open
ADustyOldMuffin opened this issue Jan 21, 2024 · 1 comment
Open

feature: Add setter for message fields #40

ADustyOldMuffin opened this issue Jan 21, 2024 · 1 comment

Comments

@ADustyOldMuffin
Copy link

I'm curious if we could add setters for fields such as arrays and messages, is there any reason you couldn't? Its quite a pain if you already have an object created to then have to create another and set all the fields.

@rcorre
Copy link
Contributor

rcorre commented Feb 3, 2024

For arrays, you can do this:

msg.get_list().assign(my_list)

I agree a way to assign a message would be useful though.
I'm not sure if set_message(msg) should copy msg, or assign a reference.

Maybe implementing CopyFrom on message types would make it more clear.

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

No branches or pull requests

2 participants