##// END OF EJS Templates
dirstate-tree: Make `DirstateMap` borrow from a bytes buffer...
dirstate-tree: Make `DirstateMap` borrow from a bytes buffer … that has the contents of the `.hg/dirstate` file. This only applies to the tree-based flavor of `DirstateMap`. For now only the entire `&[u8]` slice is stored, so this is not useful yet. Adding a lifetime parameter to the `DirstateMap` struct (in hg-core) makes Python bindings non-trivial because we keep that struct in a Python object that has a dynamic lifetime tied to Python’s reference-counting and GC. As long as we keep the `PyBytes` that owns the borrowed bytes buffer next to the borrowing struct, the buffer will live long enough for the borrows to stay valid. However this relationship cannot be expressed in safe Rust code in a way that would statisfy they borrow-checker. We use `unsafe` code to erase that lifetime parameter, and encapsulate it in a safe abstraction similar to the owning-ref crate: https://docs.rs/owning_ref/ Differential Revision: https://phab.mercurial-scm.org/D10557

File last commit:

r47882:d5956136 default
r47893:d8ac6237 default
Show More
dirstate_tree.rs
4 lines | 80 B | application/rls-services+xml | RustLexer
Simon Sapin
dirstate-tree: Empty shell for a second Rust DirstateMap implementation...
r47865 pub mod dirstate_map;
Simon Sapin
dirstate-tree: Make Rust DirstateMap bindings go through a trait object...
r47863 pub mod dispatch;
Simon Sapin
dirstate-tree: Add `WithBasename` wrapper for `HgPath`...
r47866 pub mod path_with_basename;
Simon Sapin
dirstate-tree: Give to `status()` mutable access to the `DirstateMap`...
r47882 mod status;