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

#include <context.hh>

Classes

struct  DrvDeep

Public Types

using Opaque = SingleDerivedPath::Opaque
using Built = SingleDerivedPath::Built
using Raw = std::variant<Opaque, DrvDeep, Built>

Public Member Functions

 GENERATE_CMP (NixStringContextElem, me->raw)
 MAKE_WRAPPER_CONSTRUCTOR (NixStringContextElem)
std::string to_string () const
std::string display (const StoreDirConfig &store) const

Static Public Member Functions

static NixStringContextElem parse (std::string_view s, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)

Public Attributes

Raw raw

Detailed Description

Todo
This should be renamed to StringContextBuilderElem, since:
  1. We use *Builder for off-heap temporary data structures
  2. The Nix* is totally redundant. (And my mistake from a long time ago.)

Member Typedef Documentation

◆ Built

using nix::NixStringContextElem::Built = SingleDerivedPath::Built

Derivation output.

Encoded in the form !<output>!<drvPath>.

◆ Opaque

using nix::NixStringContextElem::Opaque = SingleDerivedPath::Opaque

Plain opaque path to some store object.

Encoded as just the path: <path>.

Member Function Documentation

◆ display()

std::string nix::NixStringContextElem::display ( const StoreDirConfig & store) const

Render for use in error messages and other user-facing output.

Uses store paths and DerivedPath syntax, unlike to_string() which uses the internal encoding.

◆ parse()

NixStringContextElem nix::NixStringContextElem::parse ( std::string_view s,
const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings )
static

Decode a context string, one of:

  • <path>
  • =<path>
  • !<name>!<path>
Parameters
xpSettingsStop-gap to avoid globals during unit tests.

The documentation for this struct was generated from the following files:
  • libexpr/include/nix/expr/value/context.hh
  • libexpr/value/context.cc