Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nar-accessor.hh File Reference
#include "nix/util/fun.hh"
#include "nix/util/nar-listing.hh"
#include <functional>
#include <filesystem>

Go to the source code of this file.

Classes

struct  nix::NarAccessor

Typedefs

using nix::GetNarBytes = fun<void(uint64_t, uint64_t, Sink &)>

Functions

ref< NarAccessor > nix::makeNarAccessor (std::string &&nar)
ref< NarAccessor > nix::makeNarAccessor (NarListing listing)
GetNarBytes nix::seekableGetNarBytes (const std::filesystem::path &path)
GetNarBytes nix::seekableGetNarBytes (Descriptor fd)
ref< NarAccessor > nix::makeLazyNarAccessor (NarListing listing, GetNarBytes getNarBytes)

Typedef Documentation

◆ GetNarBytes

using nix::GetNarBytes = fun<void(uint64_t, uint64_t, Sink &)>

Create a NAR accessor from a NAR listing (in the format produced by listNar()). The callback getNarBytes(offset, length) is used by the readFile() method of the accessor to get the contents of files inside the NAR.

Function Documentation

◆ makeLazyNarAccessor()

ref< NarAccessor > nix::makeLazyNarAccessor ( NarListing listing,
GetNarBytes getNarBytes )

Creates a NAR accessor from a given listing and a GetNarBytes getter.

◆ makeNarAccessor() [1/2]

ref< NarAccessor > nix::makeNarAccessor ( NarListing listing)

This NAR accessor doesn't actually access a NAR, and thus cannot read the contents of files. It just conveys the information which is gotten from listing.

◆ makeNarAccessor() [2/2]

ref< NarAccessor > nix::makeNarAccessor ( std::string && nar)

Return an object that provides access to the contents of a NAR file.

◆ seekableGetNarBytes()

GetNarBytes nix::seekableGetNarBytes ( const std::filesystem::path & path)

The canonical GetNarBytes function for a seekable Source.