Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
built-path.hh
Go to the documentation of this file.
1#pragma once
6#include <kj/async.h>
7
8namespace nix {
9
10struct SingleBuiltPath;
11
14 std::pair<std::string, StorePath> output;
15
16 SingleDerivedPathBuilt discardOutputPath() const;
17
18 std::string to_string(const Store & store) const;
19 static SingleBuiltPathBuilt parse(const Store & store, std::string_view, std::string_view);
20 kj::Promise<Result<JSON>> toJSON(const Store & store) const;
21
23};
24
25namespace built_path::detail {
26using SingleBuiltPathRaw = std::variant<
29>;
30}
31
32struct SingleBuiltPath : built_path::detail::SingleBuiltPathRaw {
33 using Raw = built_path::detail::SingleBuiltPathRaw;
34 using Raw::Raw;
35
36 using Opaque = DerivedPathOpaque;
37 using Built = SingleBuiltPathBuilt;
38
39 inline const Raw & raw() const {
40 return static_cast<const Raw &>(*this);
41 }
42
43 StorePath outPath() const;
44
45 SingleDerivedPath discardOutputPath() const;
46
47 static SingleBuiltPath parse(const Store & store, std::string_view);
48 kj::Promise<Result<JSON>> toJSON(const Store & store) const;
49};
50
51static inline ref<SingleBuiltPath> staticDrv(StorePath drvPath)
52{
53 return make_ref<SingleBuiltPath>(SingleBuiltPath::Opaque { drvPath });
54}
55
63 std::map<std::string, StorePath> outputs;
64
65 std::string to_string(const Store & store) const;
66 static BuiltPathBuilt parse(const Store & store, std::string_view, std::string_view);
67 kj::Promise<Result<JSON>> toJSON(const Store & store) const;
68
70};
71
72namespace built_path::detail {
73using BuiltPathRaw = std::variant<
74 DerivedPath::Opaque,
76>;
77}
78
83struct BuiltPath : built_path::detail::BuiltPathRaw {
84 using Raw = built_path::detail::BuiltPathRaw;
85 using Raw::Raw;
86
87 using Opaque = DerivedPathOpaque;
88 using Built = BuiltPathBuilt;
89
90 inline const Raw & raw() const {
91 return static_cast<const Raw &>(*this);
92 }
93
94 StorePathSet outPaths() const;
95 kj::Promise<Result<RealisedPath::Set>> toRealisedPaths(Store & store) const;
96
97 kj::Promise<Result<JSON>> toJSON(const Store & store) const;
98};
99
100typedef std::vector<BuiltPath> BuiltPaths;
101
102}
Definition path.hh:21
Definition store-api.hh:195
Definition ref.hh:19
#define DECLARE_CMP(my_type)
Definition comparator.hh:33
Definition built-path.hh:61
Definition built-path.hh:83
Definition derived-path.hh:26
Definition built-path.hh:12
Definition built-path.hh:32
Definition derived-path.hh:45
Definition derived-path.hh:101