pub struct StorePath {
pub digest: [u8; 20],
pub name: String,
}Expand description
A validated Nix store path.
Fields§
§digest: [u8; 20]The 20-byte hash digest.
name: StringThe human-readable name portion.
Implementations§
Source§impl StorePath
impl StorePath
Sourcepub fn from_absolute_path(path: &str) -> Result<Self, StorePathError>
pub fn from_absolute_path(path: &str) -> Result<Self, StorePathError>
Parse a store path from a string like /nix/store/<hash>-<name>.
Sourcepub fn from_basename(basename: &str) -> Result<Self, StorePathError>
pub fn from_basename(basename: &str) -> Result<Self, StorePathError>
Parse from just the <hash>-<name> portion.
Sourcepub fn to_absolute_path(&self) -> String
pub fn to_absolute_path(&self) -> String
Render the full absolute path.
Sourcepub fn to_basename(&self) -> String
pub fn to_basename(&self) -> String
Render just the <hash>-<name> basename.
Trait Implementations§
impl Eq for StorePath
impl StructuralPartialEq for StorePath
Auto Trait Implementations§
impl Freeze for StorePath
impl RefUnwindSafe for StorePath
impl Send for StorePath
impl Sync for StorePath
impl Unpin for StorePath
impl UnsafeUnpin for StorePath
impl UnwindSafe for StorePath
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