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

Avoid recursive interfaces #64

Closed
fasterthanlime opened this issue Sep 16, 2024 · 2 comments
Closed

Avoid recursive interfaces #64

fasterthanlime opened this issue Sep 16, 2024 · 2 comments

Comments

@fasterthanlime
Copy link
Contributor

To be able to deserialize deeply nested records, and also to have "filter" functionality: digging deep into a document, only deserializing what you need from it, not the whole thing, something serde doesn't really let you do.

@fasterthanlime
Copy link
Contributor Author

So I haven't fully realized the idea yet, but as of #75 the actual deserialize methods are asynchronous, which means we could return Poll::Pending in the middle of everything to avoid overflowing the stack, stash that future somewhere, continue with another future (for deeper deserialization), and resume the other one when we're done.

I think. I need to think more about, uh, how the whole thing would be implemented, because the future that yields would need to give information to the waker on: what type to deserialize, where to deserialize it.

Worth experimenting with further later.

@fasterthanlime
Copy link
Contributor Author

This has been handled in #96 — recursive interfaces are fine, I did the async thing, it works unreasonably well. I guess I should introduce InfiniteStackDrop and others — because there's the same problem when it comes to freeing them.

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

1 participant