json icon indicating copy to clipboard operation
json copied to clipboard

Use RawValue for lazy loading from files?

Open Timmmm opened this issue 1 year ago • 0 comments

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?

Timmmm avatar Sep 19 '24 12:09 Timmmm