Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::Source Struct Referenceabstract

#include <serialise.hh>

Inheritance diagram for nix::Source:
nix::ArchiveDecompressionSource nix::BufferedSource nix::ChainSource nix::FramedSource nix::LambdaSource nix::LengthSource nix::NarAccessor::NarIndexer nix::SizedSource nix::StreamToSourceAdapter nix::StringSource nix::TeeSource

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 ()
 

Detailed Description

Abstract source of binary data.

Member Function Documentation

◆ operator()()

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.

◆ read()

virtual size_t nix::Source::read ( char * data,
size_t len )
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::ArchiveDecompressionSource, nix::BufferedSource, nix::ChainSource, nix::FramedSource, nix::LambdaSource, nix::LengthSource, nix::NarAccessor::NarIndexer, nix::SizedSource, nix::StreamToSourceAdapter, nix::StringSource, and nix::TeeSource.


The documentation for this struct was generated from the following files: