RHGitaly: reading GitLab ref files
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).
parent
29fc9a2b
No related branches found
No related tags found
Showing
- rust/Cargo.lock 4 additions, 0 deletionsrust/Cargo.lock
- rust/rhgitaly/Cargo.toml 8 additions, 2 deletionsrust/rhgitaly/Cargo.toml
- rust/rhgitaly/src/gitlab/mod.rs 6 additions, 0 deletionsrust/rhgitaly/src/gitlab/mod.rs
- rust/rhgitaly/src/gitlab/state.rs 371 additions, 0 deletionsrust/rhgitaly/src/gitlab/state.rs
- rust/rhgitaly/src/lib.rs 1 addition, 0 deletionsrust/rhgitaly/src/lib.rs
rust/rhgitaly/src/gitlab/mod.rs
0 → 100644
rust/rhgitaly/src/gitlab/state.rs
0 → 100644
Please register or sign in to comment