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

Use RawValue for lazy loading from files? #1192

Open
Timmmm opened this issue Sep 19, 2024 · 0 comments
Open

Use RawValue for lazy loading from files? #1192

Timmmm opened this issue Sep 19, 2024 · 0 comments

Comments

@Timmmm
Copy link

Timmmm commented Sep 19, 2024

Suppose you have a very large JSON file containing a load of logs (strings). I want to transform them into another format, but I don't want to load all the logs into memory at once. Instead I basically want to store the file offset of those strings, and then later I want to be able to read each one lazily.

I think RawValue almost does what I want, except you can't use it with from_reader().

Is there anything like RawValue but instead of borrowing from a string it stores the offset into the input and then requires you to pass a reader to it to get the value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant