pub struct StorePathRef<'a> {
digest: [u8; 20],
name: &'a str,
}Expand description
Like StorePath, but with a &str for the name.
Fields§
§digest: [u8; 20]§name: &'a strImplementations§
Source§impl<'a> StorePathRef<'a>
impl<'a> StorePathRef<'a>
pub fn digest(&self) -> &[u8; 20]
pub fn name(&self) -> &'a str
pub fn to_owned(&self) -> StorePath
Sourcepub fn from_bytes(s: &'a [u8]) -> Result<Self, ParseStorePathError>
pub fn from_bytes(s: &'a [u8]) -> Result<Self, ParseStorePathError>
Construct by passing the $digest-$name string that comes after
STORE_DIR_WITH_SLASH.
Sourcepub fn from_name_and_digest(
name: &'a str,
digest: &[u8],
) -> Result<Self, ParseStorePathError>
pub fn from_name_and_digest( name: &'a str, digest: &[u8], ) -> Result<Self, ParseStorePathError>
Construct from a name and digest. The name is validated, and the digest checked for size.
Sourcepub fn from_name_and_digest_fixed(
name: &'a str,
digest: [u8; 20],
) -> Result<Self, ParseStorePathError>
pub fn from_name_and_digest_fixed( name: &'a str, digest: [u8; 20], ) -> Result<Self, ParseStorePathError>
Construct from a name and digest of correct length. The name is validated.
Sourcepub fn from_absolute_path(s: &'a [u8]) -> Result<Self, ParseStorePathError>
pub fn from_absolute_path(s: &'a [u8]) -> Result<Self, ParseStorePathError>
Construct from an absolute store path string. This is equivalent to calling StorePathRef::from_bytes, but stripping the STORE_DIR_WITH_SLASH prefix before.
Sourcepub fn from_absolute_path_full<'p, P>(
path: &'p P,
) -> Result<(Self, &'p Path), ParseStorePathError>
pub fn from_absolute_path_full<'p, P>( path: &'p P, ) -> Result<(Self, &'p Path), ParseStorePathError>
Decompose a string into a StorePathRef and a std::path::Path containing the rest of the path, or an error.
Sourcepub fn to_absolute_path(&self) -> String
pub fn to_absolute_path(&self) -> String
Returns as an absolute store path (prefixed with STORE_DIR_WITH_SLASH).
Sourcepub fn as_absolute_path_fmt(&'a self) -> impl Display + 'a
pub fn as_absolute_path_fmt(&'a self) -> impl Display + 'a
Returns a formatter writing an absolute store path (prefixed with STORE_DIR_WITH_SLASH).
Trait Implementations§
Source§impl<'a> AtermWriteable for &StorePathRef<'a>
impl<'a> AtermWriteable for &StorePathRef<'a>
Source§impl<'a> Clone for StorePathRef<'a>
impl<'a> Clone for StorePathRef<'a>
Source§fn clone(&self) -> StorePathRef<'a>
fn clone(&self) -> StorePathRef<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for StorePathRef<'a>
impl<'a> Debug for StorePathRef<'a>
Source§impl<'a, 'de: 'a> Deserialize<'de> for StorePathRef<'a>
Available on crate feature serde only.
impl<'a, 'de: 'a> Deserialize<'de> for StorePathRef<'a>
serde only.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 Display for StorePathRef<'_>
impl Display for StorePathRef<'_>
Source§impl Equivalent<StorePath> for StorePathRef<'_>
Available on crate feature hashbrown only.
impl Equivalent<StorePath> for StorePathRef<'_>
hashbrown only.Source§fn equivalent(&self, key: &StorePath) -> bool
fn equivalent(&self, key: &StorePath) -> bool
key and return true if they are equal.Source§impl<'a> From<StorePathRef<'a>> for StorePath
impl<'a> From<StorePathRef<'a>> for StorePath
Source§fn from(value: StorePathRef<'a>) -> Self
fn from(value: StorePathRef<'a>) -> Self
Source§impl<'a> Hash for StorePathRef<'a>
impl<'a> Hash for StorePathRef<'a>
Source§impl Ord for StorePathRef<'_>
StorePaths are sorted by their reverse digest to match the sorting order
of the nixbase32-encoded string.
impl Ord for StorePathRef<'_>
StorePaths are sorted by their reverse digest to match the sorting order
of the nixbase32-encoded string.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialEq for StorePathRef<'a>
impl<'a> PartialEq for StorePathRef<'a>
Source§fn eq(&self, other: &StorePathRef<'a>) -> bool
fn eq(&self, other: &StorePathRef<'a>) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for StorePathRef<'_>
impl PartialOrd for StorePathRef<'_>
Source§impl Serialize for StorePathRef<'_>
Available on crate feature serde only.
impl Serialize for StorePathRef<'_>
serde only.impl<'a> Eq for StorePathRef<'a>
impl<'a> StructuralPartialEq for StorePathRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for StorePathRef<'a>
impl<'a> RefUnwindSafe for StorePathRef<'a>
impl<'a> Send for StorePathRef<'a>
impl<'a> Sync for StorePathRef<'a>
impl<'a> Unpin for StorePathRef<'a>
impl<'a> UnsafeUnpin for StorePathRef<'a>
impl<'a> UnwindSafe for StorePathRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.