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

#include <content-address.hh>

Public Types

typedef std::variant< TextIngestionMethod, FileIngestionMethodRaw

Public Member Functions

 GENERATE_CMP (ContentAddressMethod, me->raw)
 MAKE_WRAPPER_CONSTRUCTOR (ContentAddressMethod)
std::string renderPrefix () const
std::string render (HashType ht) const

Static Public Member Functions

static ContentAddressMethod parsePrefix (std::string_view &m)
static std::pair< ContentAddressMethod, HashType > parse (std::string_view rawCaMethod)

Public Attributes

Raw raw

Detailed Description

An enumeration of all the ways we can serialize file system objects.

Just the type of a content address. Combine with the hash itself, and we have a ContentAddress as defined below. Combine that, in turn, with info on references, and we have ContentAddressWithReferences, as defined further below.

Member Function Documentation

◆ parse()

std::pair< ContentAddressMethod, HashType > nix::ContentAddressMethod::parse ( std::string_view rawCaMethod)
static

Parse a content addressing method and hash type.

◆ parsePrefix()

ContentAddressMethod nix::ContentAddressMethod::parsePrefix ( std::string_view & m)
static

Parse the prefix tag which indicates how the files were ingested, with the fixed output case not prefixed for back compat.

Parameters
[in]mA string that should begin with the prefix.
[out]mThe remainder of the string after the prefix.

◆ render()

std::string nix::ContentAddressMethod::render ( HashType ht) const

Render a content addressing method and hash type in a nicer way, prefixing both cases.

The rough inverse of parse().

◆ renderPrefix()

std::string nix::ContentAddressMethod::renderPrefix ( ) const

Render the prefix tag which indicates how the files wre ingested.

The rough inverse of parsePrefix().


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