Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::FramedSource Class Reference

#include <serialise.hh>

Inheritance diagram for nix::FramedSource:
nix::Source

Public Member Functions

 FramedSource (Source &from)
 FramedSource (FramedSource &&)=delete
 FramedSource (const FramedSource &)=delete
FramedSource & operator= (FramedSource &&)=delete
FramedSource & operator= (const FramedSource &)=delete
size_t read (char *data, size_t len) override
Public Member Functions inherited from nix::Source
void operator() (char *data, size_t len)
void operator() (std::string_view data)
virtual bool good ()
void drainInto (Sink &sink)
virtual void drainInto (Sink &sink, uint64_t len)
std::string drain ()
virtual void skip (size_t len)

Detailed Description

A source that reads a distinct format of concatenated chunks back into its logical form, in order to guarantee a known state to the original stream, even in the event of errors.

Use with FramedSink, which also allows the logical stream to be terminated in the event of an exception.

Member Function Documentation

◆ read()

size_t nix::FramedSource::read ( char * data,
size_t len )
inlineoverridevirtual

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.


The documentation for this class was generated from the following files:
  • libutil/include/nix/util/serialise.hh
  • libutil/serialise.cc