Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nar-accessor.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/fun.hh"
6
7#include <functional>
8#include <filesystem>
9
10namespace nix {
11
12struct Source;
13
17struct NarAccessor : SourceAccessor
18{
22 virtual const NarListing & getListing() const = 0;
23
24 ~NarAccessor() override;
25};
26
31ref<NarAccessor> makeNarAccessor(std::string && nar);
32
39
46using GetNarBytes = fun<void(uint64_t, uint64_t, Sink &)>;
47
51GetNarBytes seekableGetNarBytes(const std::filesystem::path & path);
52
54
59
60} // namespace nix
Definition fun.hh:19
Definition ref.hh:58
int Descriptor
Definition file-descriptor.hh:36
ref< NarAccessor > makeLazyNarAccessor(NarListing listing, GetNarBytes getNarBytes)
Definition nar-accessor.cc:159
GetNarBytes seekableGetNarBytes(const std::filesystem::path &path)
Definition nar-accessor.cc:164
ref< NarAccessor > makeNarAccessor(std::string &&nar)
Definition nar-accessor.cc:149
fun< void(uint64_t, uint64_t, Sink &)> GetNarBytes
Definition nar-accessor.hh:46
fso::VariantT< NarListingRegularFile, true > NarListing
Definition nar-listing.hh:28
Definition nar-accessor.hh:18
virtual const NarListing & getListing() const =0
Definition serialise.hh:18
Definition serialise.hh:95