pub struct Store { /* private fields */ }Expand description
Nix store for managing packages and derivations.
The store provides access to Nix packages, derivations, and store paths.
Implementations§
Source§impl Store
impl Store
Sourcepub fn realize(&self, path: &StorePath) -> Result<Vec<(String, StorePath)>>
pub fn realize(&self, path: &StorePath) -> Result<Vec<(String, StorePath)>>
Realize a store path.
This builds/downloads the store path and all its dependencies, making them available in the local store.
§Arguments
path- The store path to realize
§Returns
A vector of (output_name, store_path) tuples for each realized output. For example, a derivation might produce outputs like (“out”, path1), (“dev”, path2).
§Errors
Returns an error if the path cannot be realized.
Sourcepub fn store_path(&self, path: &str) -> Result<StorePath>
pub fn store_path(&self, path: &str) -> Result<StorePath>
Parse a store path string into a StorePath.
This is a convenience method that wraps StorePath::parse().
§Arguments
path- The store path string (e.g., “/nix/store/…”)
§Errors
Returns an error if the path cannot be parsed.
§Example
let ctx = Arc::new(Context::new()?);
let store = Store::open(&ctx, None)?;
let path = store.store_path("/nix/store/...")?;Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more