Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::CommonProto::Serialise< std::optional< StorePath > > Struct Reference

#include <common-protocol.hh>

Static Public Member Functions

static std::optional< StorePathread (const StoreDirConfig &store, CommonProto::ReadConn conn)
 
static void write (const StoreDirConfig &store, CommonProto::WriteConn conn, const std::optional< StorePath > &str)
 

Detailed Description

These use the empty string for the null case, relying on the fact that the underlying types never serialize to the empty string.

We do this instead of a generic std::optional<T> instance because ordinal tags (0 or 1, here) are a bit of a compatability hazard. For the same reason, we don't have a std::variant<T..> instances (ordinal tags 0...n).

We could the generic instances and then these as specializations for compatability, but that's proven a bit finnicky, and also makes the worker protocol harder to implement in other languages where such specializations may not be allowed.


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