feat: Store::realise, Store::add_derivation, Store::derivation_from_json
This commit is contained in:
parent
2d210260f9
commit
da869e998c
5 changed files with 486 additions and 1 deletions
21
rust/nix-bindings-store/src/derivation.rs
Normal file
21
rust/nix-bindings-store/src/derivation.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use nix_bindings_bindgen_raw as raw;
|
||||
use std::ptr::NonNull;
|
||||
|
||||
/// A Nix derivation
|
||||
pub struct Derivation {
|
||||
pub(crate) inner: NonNull<raw::derivation>,
|
||||
}
|
||||
|
||||
impl Derivation {
|
||||
pub(crate) fn new_raw(inner: NonNull<raw::derivation>) -> Self {
|
||||
Derivation { inner }
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Derivation {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
raw::derivation_free(self.inner.as_ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue