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

#include <print.hh>

Public Member Functions

 ValuePrinter (EvalState &state, Value &value, PrintOptions options=PrintOptions {})

Friends

std::ostream & operator<< (std::ostream &output, const ValuePrinter &printer)

Detailed Description

A partially-applied form of printValue which can be formatted using << without allocating an intermediate string. This class should not outlive the eval state or it will UAF. FIXME: This should take nix::refs, to avoid that, but our eval methods all have EvalState &, not ref<EvalState>, and constructing a new shared_ptr to data that already has a shared_ptr is a much bigger footgun. In the current architecture of libexpr, using a ValuePrinter after an EvalState has been destroyed would be pretty hard.


The documentation for this class was generated from the following file: