Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ContentAddress Struct Reference

#include <content-address.hh>

Public Member Functions

 GENERATE_CMP (ContentAddress, me->method, me->hash)
std::string render () const
std::string printMethodAlgo () const

Static Public Member Functions

static ContentAddress parse (std::string_view rawCa)
static std::optional< ContentAddressparseOpt (std::string_view rawCaOpt)

Public Attributes

ContentAddressMethod method
Hash hash

Detailed Description

We've accumulated several types of content-addressed paths over the years; fixed-output derivations support multiple hash algorithms and serialisation methods (flat file vs NAR). Thus, ‘ca’ has one of the following forms:

  • ‘text:sha256:<sha256 hash of file contents>’: For paths computed by Store::makeTextPath() / Store::addTextToStore().
  • ‘fixed:<r?>:<ht>:<h>’: For paths computed by Store::makeFixedOutputPath() / Store::addToStore().

Member Function Documentation

◆ render()

std::string nix::ContentAddress::render ( ) const

Compute the content-addressability assertion (ValidPathInfo::ca) for paths created by Store::makeFixedOutputPath() / Store::addToStore().

Member Data Documentation

◆ hash

Hash nix::ContentAddress::hash

Hash of that serialization

◆ method

ContentAddressMethod nix::ContentAddress::method

How the file system objects are serialized


The documentation for this struct was generated from the following files: