Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::ContentAddress Struct Reference

#include <content-address.hh>

Public Member Functions

bool operator== (const ContentAddress &) const =default
 
auto operator<=> (const ContentAddress &) const =default
 
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:

  • TextIngestionMethod: text:sha256:<sha256 hash of file contents>
  • FixedIngestionMethod: fixed:<r?>:<hash algorithm>:<hash of file contents>

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: