#include <serialise.hh>
Public Member Functions | |
void | operator() (char *data, size_t len) |
void | operator() (std::string_view data) |
virtual size_t | read (char *data, size_t len)=0 |
virtual bool | good () |
void | drainInto (Sink &sink) |
std::string | drain () |
Abstract source of binary data.
Store exactly ‘len’ bytes in the buffer pointed to by ‘data’. It blocks until all the requested data is available, or throws an error if it is not going to be available.
Store up to ‘len’ in the buffer pointed to by ‘data’, and return the number of bytes stored. It blocks until at least one byte is available.
Implemented in nix::ArchiveDecompressionSource, nix::BufferedSource, nix::ChainSource, nix::FramedSource, nix::LambdaSource, nix::LengthSource, nix::NarAccessor::NarIndexer, nix::SizedSource, nix::StreamToSourceAdapter, nix::StringSource, and nix::TeeSource.