mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Restrict some code to StoreDirConfig
- part of eval cache - part of derivations - derived path - store path with outputs - serializers
This commit is contained in:
parent
e97ac09abe
commit
dde1d86338
30 changed files with 175 additions and 157 deletions
|
@ -16,11 +16,11 @@ namespace nix {
|
|||
/* protocol-agnostic templates */
|
||||
|
||||
#define SERVE_USE_LENGTH_PREFIX_SERIALISER(TEMPLATE, T) \
|
||||
TEMPLATE T ServeProto::Serialise< T >::read(const Store & store, ServeProto::ReadConn conn) \
|
||||
TEMPLATE T ServeProto::Serialise< T >::read(const StoreDirConfig & store, ServeProto::ReadConn conn) \
|
||||
{ \
|
||||
return LengthPrefixedProtoHelper<ServeProto, T >::read(store, conn); \
|
||||
} \
|
||||
TEMPLATE void ServeProto::Serialise< T >::write(const Store & store, ServeProto::WriteConn conn, const T & t) \
|
||||
TEMPLATE void ServeProto::Serialise< T >::write(const StoreDirConfig & store, ServeProto::WriteConn conn, const T & t) \
|
||||
{ \
|
||||
LengthPrefixedProtoHelper<ServeProto, T >::write(store, conn, t); \
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ SERVE_USE_LENGTH_PREFIX_SERIALISER(
|
|||
template<typename T>
|
||||
struct ServeProto::Serialise
|
||||
{
|
||||
static T read(const Store & store, ServeProto::ReadConn conn)
|
||||
static T read(const StoreDirConfig & store, ServeProto::ReadConn conn)
|
||||
{
|
||||
return CommonProto::Serialise<T>::read(store,
|
||||
CommonProto::ReadConn { .from = conn.from });
|
||||
}
|
||||
static void write(const Store & store, ServeProto::WriteConn conn, const T & t)
|
||||
static void write(const StoreDirConfig & store, ServeProto::WriteConn conn, const T & t)
|
||||
{
|
||||
CommonProto::Serialise<T>::write(store,
|
||||
CommonProto::WriteConn { .to = conn.to },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue