feat: Store.get_storedir()
(cherry picked from commit 6f4ba636f1e563167e6456d42c9fb6f65c9ca504)
This commit is contained in:
parent
3d3c77eced
commit
c9d54ccbc6
5 changed files with 63 additions and 4 deletions
|
|
@ -172,6 +172,21 @@ impl Store {
|
|||
r
|
||||
}
|
||||
|
||||
#[cfg(nix_at_least = "2.26")]
|
||||
#[doc(alias = "nix_store_get_storedir")]
|
||||
pub fn get_storedir(&mut self) -> Result<String> {
|
||||
let mut r = result_string_init!();
|
||||
unsafe {
|
||||
check_call!(raw::store_get_storedir(
|
||||
&mut self.context,
|
||||
self.inner.ptr(),
|
||||
Some(callback_get_result_string),
|
||||
callback_get_result_string_data(&mut r)
|
||||
))
|
||||
}?;
|
||||
r
|
||||
}
|
||||
|
||||
pub fn weak_ref(&self) -> StoreWeak {
|
||||
StoreWeak {
|
||||
inner: Arc::downgrade(&self.inner),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue