Struct nix_compat::store_path::StorePath
source · pub struct StorePath {
digest: [u8; 20],
name: Box<str>,
}
Expand description
Represents a path in the Nix store (a direct child of STORE_DIR).
It consists of a digest (20 bytes), and a name, which is a string.
The name may only contain ASCII alphanumeric, or one of the following
characters: -
, _
, .
, +
, ?
, =
.
The name is usually used to describe the pname and version of a package.
Derivation paths can also be represented as store paths, their names just
end with the .drv
prefix.
A StorePath does not encode any additional subpath “inside” the store path.
Fields§
§digest: [u8; 20]
§name: Box<str>
Implementations§
source§impl StorePath
impl StorePath
sourcepub fn from_bytes(s: &[u8]) -> Result<StorePath, Error>
pub fn from_bytes(s: &[u8]) -> Result<StorePath, Error>
Construct a StorePath by passing the $digest-$name
string
that comes after STORE_DIR_WITH_SLASH.
sourcepub fn to_absolute_path(&self) -> String
pub fn to_absolute_path(&self) -> String
Returns an absolute store path string. That is just the string representation, prefixed with the store prefix (STORE_DIR_WITH_SLASH),
Trait Implementations§
source§impl AtermWriteable for StorePath
impl AtermWriteable for StorePath
source§impl<'de> Deserialize<'de> for StorePath
impl<'de> Deserialize<'de> for StorePath
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl<'a> From<&'a StorePath> for StorePathRef<'a>
impl<'a> From<&'a StorePath> for StorePathRef<'a>
source§impl Ord for StorePath
impl Ord for StorePath
StorePath
s are sorted by their reverse digest to match the sorting order
of the nixbase32-encoded string.
source§impl PartialEq for StorePath
impl PartialEq for StorePath
source§impl PartialOrd for StorePath
impl PartialOrd for StorePath
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more