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

Serializing from borrowed TypedReader #524

Open
marmeladema opened this issue Oct 15, 2024 · 2 comments · May be fixed by #526
Open

Serializing from borrowed TypedReader #524

marmeladema opened this issue Oct 15, 2024 · 2 comments · May be fixed by #526

Comments

@marmeladema
Copy link
Contributor

Hello,

I happen to face a situation where in some API I have a borrowed TypedReader and I need to serialize it.

I might have missed something, but it seems to serialize from a reader, I need access to the ReaderSegments which I can only obtain by doing typed_reader.into_inner().into_segments() which is consuming the input TypedReader.
However the serializing functions (the _to_words ones) actually accept a borrowed ReaderSegments.

Is there a reason for not exposing a borrowed ReaderSegments?
If we added a method like get_reader_segments(&self) -> &S it should fix my issue.

Thank you for your help.

@dwrensha
Copy link
Member

Adding a message::Reader::get_segments() method makes sense to me.

@marmeladema
Copy link
Contributor Author

Okay I'll try to open a PR soon :-)

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 a pull request may close this issue.

2 participants