diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-09-30 23:47:53 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-09-30 23:47:53 +0000 |
commit | 1ef88da3503b88f289a15786dfd48821cf5b6502 (patch) | |
tree | aef8833d734cf1f892b27a54ae969641a20c9d7b /src/libutil/serialise.hh | |
parent | 8499f32fb2e7fdf09e97d0beb1fe78bef5900d93 (diff) | |
parent | 6a8d6246f603a372d557ab026670ae42bad558b0 (diff) |
Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputs
Diffstat (limited to 'src/libutil/serialise.hh')
-rw-r--r-- | src/libutil/serialise.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index 5bbbc7ce3..0fe6e8332 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -25,6 +25,13 @@ struct NullSink : Sink { } }; + +struct FinishSink : virtual Sink +{ + virtual void finish() = 0; +}; + + /* A buffered abstract sink. Warning: a BufferedSink should not be used from multiple threads concurrently. */ struct BufferedSink : virtual Sink @@ -281,6 +288,7 @@ struct ChainSource : Source size_t read(char * data, size_t len) override; }; +std::unique_ptr<FinishSink> sourceToSink(std::function<void(Source &)> fun); /* Convert a function that feeds data into a Sink into a Source. The Source executes the function as a coroutine. */ |