improve concurrency control; use nar_size from cpathinfo
This commit is contained in:
parent
ca97aebd7a
commit
e5336d304d
6 changed files with 33 additions and 8 deletions
|
@ -228,6 +228,8 @@ mod ffi {
|
|||
|
||||
/// Mid-level wrapper for the `nix::ValidPathInfo` struct.
|
||||
type CPathInfo;
|
||||
/// Returns the size of the NAR.
|
||||
fn nar_size(self: Pin<&mut CPathInfo>) -> u64;
|
||||
|
||||
/// Returns the references of the store path.
|
||||
fn references(self: Pin<&mut CPathInfo>) -> UniquePtr<CxxVector<CxxString>>;
|
||||
|
|
|
@ -57,6 +57,10 @@ void RustSink::eof() {
|
|||
|
||||
CPathInfo::CPathInfo(nix::ref<const nix::ValidPathInfo> pi) : pi(pi) {}
|
||||
|
||||
uint64_t CPathInfo::nar_size() {
|
||||
return this->pi->narSize;
|
||||
}
|
||||
|
||||
std::unique_ptr<std::vector<std::string>> CPathInfo::sigs() {
|
||||
std::vector<std::string> result;
|
||||
for (auto&& elem : this->pi->sigs) {
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
CPathInfo(nix::ref<const nix::ValidPathInfo> pi);
|
||||
std::unique_ptr<std::vector<std::string>> sigs();
|
||||
std::unique_ptr<std::vector<std::string>> references();
|
||||
uint64_t nar_size();
|
||||
};
|
||||
|
||||
class CNixStore {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue