#include <serialise.hh>
Public Types | |
typedef std::function< size_t(char *, size_t)> | lambda_t |
Public Member Functions | |
LambdaSource (const lambda_t &lambda) | |
size_t | read (char *data, size_t len) override |
![]() | |
void | operator() (char *data, size_t len) |
void | operator() (std::string_view data) |
virtual bool | good () |
void | drainInto (Sink &sink) |
std::string | drain () |
Public Attributes | |
lambda_t | lambda |
Convert a function into a source.
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.
Implements nix::Source.