Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::IndirectAsyncInputStreamToSource Class Reference

#include <async-io.hh>

Inheritance diagram for nix::IndirectAsyncInputStreamToSource:
nix::Source

Public Member Functions

 IndirectAsyncInputStreamToSource (AsyncInputStream &source)
 IndirectAsyncInputStreamToSource (box_ptr< AsyncInputStream > owned)
 KJ_DISALLOW_COPY_AND_MOVE (IndirectAsyncInputStreamToSource)
kj::Promise< void > feed ()
size_t read (char *data, size_t len) override
Public Member Functions inherited from nix::Source
void operator() (char *data, size_t len)
virtual bool good ()
void drainInto (Sink &sink)
std::string drain ()

Detailed Description

Wraps a stream in a source. The returned source must not be used on the event loop that created it, otherwise read requests cannot be serviced.

Member Function Documentation

◆ feed()

kj::Promise< void > nix::IndirectAsyncInputStreamToSource::feed ( )

Feed the source. Must be awaited fully to drain the input stream.

◆ read()

size_t nix::IndirectAsyncInputStreamToSource::read ( char * data,
size_t len )
overridevirtual

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.

Should not return 0 (generally you want to throw EndOfFile), but nothing stops that.

Exceptions
EndOfFileif there is no more data.

Implements nix::Source.


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