pub struct Derivation { /* private fields */ }Expand description
A Nix derivation
Requires Nix 2.33 or later.
Implementations§
Source§impl Derivation
impl Derivation
Sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Convert the derivation to JSON (which is encoded to a string).
Requires Nix 2.33 or later.
The JSON format follows the Nix derivation JSON schema. Note that this format is experimental as of writing.
Sourcepub unsafe fn new_raw_clone(inner: NonNull<derivation>) -> Self
pub unsafe fn new_raw_clone(inner: NonNull<derivation>) -> Self
This is a low level function that you shouldn’t have to call unless you are developing the Nix bindings.
Construct a new Derivation by first cloning the C derivation.
§Safety
This does not take ownership of the C derivation, so it should be a borrowed pointer, or you should free it.
Sourcepub unsafe fn as_ptr(&self) -> *mut derivation
pub unsafe fn as_ptr(&self) -> *mut derivation
This is a low level function that you shouldn’t have to call unless you are developing the Nix bindings.
Get a pointer to the underlying Nix C API derivation.
§Safety
This function is unsafe because it returns a raw pointer. The caller must ensure that the pointer is not used beyond the lifetime of this Derivation.