Struct tvix_store::proto::NarInfo
source · pub struct NarInfo {
pub nar_size: u64,
pub nar_sha256: Bytes,
pub signatures: Vec<Signature>,
pub reference_names: Vec<String>,
pub deriver: Option<StorePath>,
pub ca: Option<Ca>,
}
Expand description
Nix C++ uses NAR (Nix Archive) as a format to transfer store paths, and stores metadata and signatures in NARInfo files. Store all these attributes in a separate message.
This is useful to render .narinfo files to clients, or to preserve/validate these signatures. As verifying these signatures requires the whole NAR file to be synthesized, moving to another signature scheme is desired. Even then, it still makes sense to hold this data, for old clients.
Fields§
§nar_size: u64
This size of the NAR file, in bytes.
nar_sha256: Bytes
The sha256 of the NAR file representation.
signatures: Vec<Signature>
The signatures in a .narinfo file.
reference_names: Vec<String>
A list of references. To validate .narinfo signatures, a fingerprint needs to be constructed. This fingerprint doesn’t just contain the hashes of the output paths of all references (like PathInfo.references), but their whole (base)names, so we need to keep them somewhere.
deriver: Option<StorePath>
The StorePath of the .drv file producing this output.
The .drv suffix is omitted in its name
field.
ca: Option<Ca>
The CA field in the .narinfo. Its textual representations seen in the wild are one of the following:
fixed:r:sha256:1gcky5hlf5vqfzpyhihydmm54grhc94mcs8w7xr8613qsqb1v2j6
fixed-output derivations using “recursive”outputHashMode
.fixed:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8 fixed-output derivations using "flat"
outputHashMode`text:sha256:19xqkh72crbcba7flwxyi3n293vav6d7qkzkh2v4zfyi4iia8vj8
Text 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.
We use an enum to encode the possible combinations, and optimize for the
common case, fixed:recursive
, identified as NAR_SHA256
.
Trait Implementations§
source§impl Message for NarInfo
impl Message for NarInfo
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.impl StructuralPartialEq for NarInfo
Auto Trait Implementations§
impl !Freeze for NarInfo
impl RefUnwindSafe for NarInfo
impl Send for NarInfo
impl Sync for NarInfo
impl Unpin for NarInfo
impl UnwindSafe for NarInfo
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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