feat: Add nix-expr library, update nix

(cherry picked from commit bf1ddd1c9137578b86895577d5b80e0c5771b605)
This commit is contained in:
Robert Hensing 2024-03-19 14:43:01 +01:00
parent be8aa55a38
commit 6978e91fa9
11 changed files with 399 additions and 9 deletions

View file

@ -29,7 +29,7 @@ impl StoreRef {
impl Drop for StoreRef {
fn drop(&mut self) {
unsafe {
raw::nix_store_unref(self.inner.as_ptr());
raw::nix_store_free(self.inner.as_ptr());
}
}
}
@ -73,6 +73,10 @@ impl Store {
Ok(store)
}
pub fn raw_ptr(&self) -> *mut raw::Store {
self.inner.ptr()
}
pub fn get_uri(&self) -> Result<String> {
const N: usize = 1024;
let mut buffer: [MaybeUninit<u8>; N] = unsafe { MaybeUninit::uninit().assume_init() };