mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Factor out UnkeyedValidPathInfo
and test
This makes the path info serialisers ideomatic again, which allows me to test them.
This commit is contained in:
parent
596bd469cc
commit
70f8b96c11
10 changed files with 218 additions and 34 deletions
|
@ -32,6 +32,7 @@ struct DerivedPath;
|
|||
struct BuildResult;
|
||||
struct KeyedBuildResult;
|
||||
struct ValidPathInfo;
|
||||
struct UnkeyedValidPathInfo;
|
||||
enum TrustedFlag : bool;
|
||||
|
||||
|
||||
|
@ -207,6 +208,10 @@ DECLARE_WORKER_SERIALISER(BuildResult);
|
|||
template<>
|
||||
DECLARE_WORKER_SERIALISER(KeyedBuildResult);
|
||||
template<>
|
||||
DECLARE_WORKER_SERIALISER(ValidPathInfo);
|
||||
template<>
|
||||
DECLARE_WORKER_SERIALISER(UnkeyedValidPathInfo);
|
||||
template<>
|
||||
DECLARE_WORKER_SERIALISER(std::optional<TrustedFlag>);
|
||||
|
||||
template<typename T>
|
||||
|
@ -221,15 +226,4 @@ template<typename K, typename V>
|
|||
DECLARE_WORKER_SERIALISER(std::map<K COMMA_ V>);
|
||||
#undef COMMA_
|
||||
|
||||
/* These are a non-standard form for historical reasons. */
|
||||
|
||||
template<>
|
||||
struct WorkerProto::Serialise<ValidPathInfo>
|
||||
{
|
||||
static ValidPathInfo read(const Store & store, WorkerProto::ReadConn conn);
|
||||
static ValidPathInfo read(const Store & store, WorkerProto::ReadConn conn, StorePath && path);
|
||||
|
||||
static void write(const Store & store, WriteConn conn, const ValidPathInfo & pathInfo, bool includePath = true);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue