-
Georges Racinet authored
This follows the file format and conventions defined in the server side `heptapod` Python package. Since everything is async, we actually provide Streams of TypedRef objects, and the `map_lookup_typed_ref` for the numerous use cases when one is looking for a specific ref. The file format is very primitive, so all we can do at this point is to perform a full scan, but it has room (version preamble) for more advanced formats in the future (e.g, append-only persistent hash map or similar). A preliminary version of this was using Tokio's `LineStream`, but this has several drawbacks: - it is unicode-centric, yielding `String`s - we had to implement our own `Stream`, keeping the `LineStream` as a field. Hence because `poll_next()` takes `&mut Pin<Self>` we had to write a pinning accessor, which is unsafe (see the doc for `std::pin` for more details).
Georges Racinet authoredThis follows the file format and conventions defined in the server side `heptapod` Python package. Since everything is async, we actually provide Streams of TypedRef objects, and the `map_lookup_typed_ref` for the numerous use cases when one is looking for a specific ref. The file format is very primitive, so all we can do at this point is to perform a full scan, but it has room (version preamble) for more advanced formats in the future (e.g, append-only persistent hash map or similar). A preliminary version of this was using Tokio's `LineStream`, but this has several drawbacks: - it is unicode-centric, yielding `String`s - we had to implement our own `Stream`, keeping the `LineStream` as a field. Hence because `poll_next()` takes `&mut Pin<Self>` we had to write a pinning accessor, which is unsafe (see the doc for `std::pin` for more details).