use crate::sys not nixide_sys as sys
This commit is contained in:
parent
0ba06d0f2c
commit
8b78930472
3 changed files with 15 additions and 5 deletions
|
|
@ -23,10 +23,10 @@ use std::result::Result;
|
|||
|
||||
use crate::errors::{new_nixide_error, ErrorContext};
|
||||
use crate::stdext::CCharPtrExt;
|
||||
use crate::sys;
|
||||
use crate::util::wrap;
|
||||
use crate::util::wrappers::AsInnerPtr;
|
||||
use crate::{NixideError, NixideResult};
|
||||
use nixide_sys as sys;
|
||||
|
||||
/// Nix store for managing packages and derivations.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@ use std::ptr::NonNull;
|
|||
|
||||
use super::Store;
|
||||
use crate::errors::{new_nixide_error, ErrorContext};
|
||||
use crate::sys;
|
||||
use crate::util::panic_issue_call_failed;
|
||||
use crate::util::wrap;
|
||||
use crate::util::wrappers::AsInnerPtr;
|
||||
use crate::NixideResult;
|
||||
|
||||
use nixide_sys as sys;
|
||||
|
||||
/// A path in the Nix store.
|
||||
///
|
||||
/// Represents a store path that can be realized, queried, or manipulated.
|
||||
|
|
@ -20,9 +19,20 @@ pub struct StorePath {
|
|||
}
|
||||
|
||||
impl AsInnerPtr<sys::StorePath> for StorePath {
|
||||
#[inline]
|
||||
unsafe fn as_ptr(&self) -> *mut sys::StorePath {
|
||||
self.inner.as_ptr()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn as_ref(&self) -> &sys::StorePath {
|
||||
unsafe { self.inner.as_ref() }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn as_mut(&mut self) -> &mut sys::StorePath {
|
||||
unsafe { self.inner.as_mut() }
|
||||
}
|
||||
}
|
||||
|
||||
impl StorePath {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ pub trait AsInnerPtr<T> {
|
|||
|
||||
/// Returns a shared reference to the inner `libnix` C struct.
|
||||
///
|
||||
/// For the mutable counterpart see [AsInnerPtr<T>::as_mut].
|
||||
/// For the mutable counterpart see [Self::as_mut].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
|
|
@ -21,7 +21,7 @@ pub trait AsInnerPtr<T> {
|
|||
|
||||
/// Returns a unique reference to the inner `libnix` C struct.
|
||||
///
|
||||
/// For the shared counterpart see [AsInnerPtr<T>::as_ref].
|
||||
/// For the shared counterpart see [Self::as_ref].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue