pub struct NarInfo<'a> {Show 13 fields
pub flags: Flags,
pub store_path: StorePathRef<'a>,
pub nar_hash: [u8; 32],
pub nar_size: u64,
pub references: Vec<StorePathRef<'a>>,
pub signatures: Vec<SignatureRef<'a>>,
pub ca: Option<CAHash>,
pub system: Option<&'a str>,
pub deriver: Option<StorePathRef<'a>>,
pub url: &'a str,
pub compression: Option<&'a str>,
pub file_hash: Option<[u8; 32]>,
pub file_size: Option<u64>,
}Fields§
§flags: Flags§store_path: StorePathRef<'a>Store path described by this NarInfo
nar_hash: [u8; 32]SHA-256 digest of the NAR file
nar_size: u64Size of the NAR file in bytes
references: Vec<StorePathRef<'a>>Store paths known to be referenced by the contents
signatures: Vec<SignatureRef<'a>>Ed25519 signature over the path fingerprint
ca: Option<CAHash>Content address (for content-defined paths)
system: Option<&'a str>Nix system triple of NarInfo::deriver
deriver: Option<StorePathRef<'a>>Store path of the derivation that produced this. The last .drv suffix is stripped.
url: &'a strRelative URL of the compressed NAR file
compression: Option<&'a str>Compression method of the NAR file
None means Compression: none.
Nix interprets a missing Compression field as Some("bzip2"),
so we do as well. We haven’t found any examples of this in the
wild, not even in the cache.nixos.org dataset.
file_hash: Option<[u8; 32]>SHA-256 digest of the file at url
file_size: Option<u64>Size of the file at url in bytes
Implementations§
Source§impl<'a> NarInfo<'a>
impl<'a> NarInfo<'a>
pub fn parse(input: &'a str) -> Result<Self, Error>
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Computes the fingerprint string for certain fields in this NarInfo. This fingerprint is signed in [self.signatures].
Sourcepub fn add_signature<S>(&mut self, signer: &'a SigningKey<S>)
pub fn add_signature<S>(&mut self, signer: &'a SigningKey<S>)
Adds a signature, using the passed signer to sign. This is generic over algo implementations / providers, so users can bring their own signers.