![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#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) |
| virtual void | drainInto (Sink &sink, uint64_t len) |
| std::string | drain () |
| virtual void | skip (size_t len) |
Abstract source of binary data.
|
virtual |
| void nix::Source::operator() | ( | char * | data, |
| size_t | len ) |
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.
|
pure virtual |
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::BufferedSource, nix::ChainSource, nix::EnsureRead, nix::FramedSource, nix::LambdaSource, nix::LengthSource, nix::SizedSource, nix::StringSource, and nix::TeeSource.