Struct nix_compat::narinfo::NarInfo

source ·
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: u64

Size 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 str

Relative 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>

source

pub fn parse(input: &'a str) -> Result<Self, Error>

source

pub fn fingerprint(&self) -> String

Computes the fingerprint string for certain fields in this NarInfo. This fingerprint is signed in [self.signatures].

source

pub fn add_signature<S>(&mut self, signer: &'a SigningKey<S>)
where S: Signer<Signature>,

Adds a signature, using the passed signer to sign. This is generic over algo implementations / providers, so users can bring their own signers.

Trait Implementations§

source§

impl<'a> Debug for NarInfo<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NarInfo<'_>

source§

fn fmt(&self, w: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for NarInfo<'a>

§

impl<'a> RefUnwindSafe for NarInfo<'a>

§

impl<'a> Send for NarInfo<'a>

§

impl<'a> Sync for NarInfo<'a>

§

impl<'a> Unpin for NarInfo<'a>

§

impl<'a> UnwindSafe for NarInfo<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more