pub struct PathInfo {
pub store_path: StorePath<String>,
pub node: Node,
pub references: Vec<StorePath<String>>,
pub nar_size: u64,
pub nar_sha256: [u8; 32],
pub signatures: Vec<Signature<String>>,
pub deriver: Option<StorePath<String>>,
pub ca: Option<CAHash>,
}Expand description
Holds metadata about a store path, but not its contents.
This is somewhat equivalent to the information Nix holds in its SQLite database, or publishes as .narinfo files, except we also embed the snix_castore::Node describing the contents in the castore model.
Fields§
§store_path: StorePath<String>The store path this is about.
node: NodeThe contents in the snix-castore model.
references: Vec<StorePath<String>>A list of references.
nar_size: u64The size of the NAR representation of the contents, in bytes.
nar_sha256: [u8; 32]The sha256 digest of the NAR representation of the contents.
signatures: Vec<Signature<String>>The signatures, usually shown in a .narinfo file.
deriver: Option<StorePath<String>>The StorePath of the .drv file producing this output.
The .drv suffix is omitted in its name field.
ca: Option<CAHash>The CA field in the .narinfo. Its textual representations seen in the wild are one of the following:
fixed:r:sha256:1gcky5hlf5vqfzpyhihydmm54grhc94mcs8w7xr8613qsqb1v2j6fixed-output derivations using “recursive”outputHashMode.fixed:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8 fixed-output derivations using "flat"outputHashMode`text:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8Text hashing, used for uploaded .drv files and outputs produced by builtins.toFile.
Semantically, they can be split into the following components:
- “content address prefix”. Currently, “fixed” and “text” are supported.
- “hash mode”. Currently, “flat” and “recursive” are supported.
- “hash type”. The underlying hash function used. Currently, sha1, md5, sha256, sha512.
- “digest”. The digest itself.
There are some restrictions on the possible combinations.
For example, text and fixed:recursive always imply sha256.
Implementations§
Source§impl PathInfo
impl PathInfo
Sourcepub fn to_narinfo(&self) -> NarInfo<'_>
pub fn to_narinfo(&self) -> NarInfo<'_>
Reconstructs a [nix_compat::narinfo::NarInfo<’_>].
It does very little allocation (a Vec each for signatures and
references), the rest points to data owned elsewhere.
It can be used to validate Signatures, or render a .narinfo file (after some more fields are populated)
Keep in mind this is not able to reconstruct all data present in the NarInfo<’_>, as some of it is not stored at all:
- the
system,file_hashandfile_sizefields are set toNone. - the URL is set to an empty string.
- Compression is set to “none”
If you want to render it out to a string and be able to parse it back in, at least URL must be set again.
Trait Implementations§
impl Eq for PathInfo
impl StructuralPartialEq for PathInfo
Auto Trait Implementations§
impl !Freeze for PathInfo
impl RefUnwindSafe for PathInfo
impl Send for PathInfo
impl Sync for PathInfo
impl Unpin for PathInfo
impl UnwindSafe for PathInfo
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> 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.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.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request