Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::fetchers::CacheImpl Struct Reference
Inheritance diagram for nix::fetchers::CacheImpl:
nix::fetchers::Cache

Classes

struct  State

Public Member Functions

void anchor () override
 CacheImpl (const Settings &_settings)
void upsert (const Key &key, const Attrs &value) override
std::optional< Attrs > lookup (const Key &key) override
std::optional< Attrs > lookupWithTTL (const Key &key) override
std::optional< Result > lookupExpired (const Key &key) override
void upsert (Key key, Store &store, Attrs value, const StorePath &storePath) override
std::optional< ResultWithStorePath > lookupStorePath (Key key, Store &store) override
std::optional< ResultWithStorePath > lookupStorePathWithTTL (Key key, Store &store) override

Public Attributes

Sync< State > _state
const Settings & settings

Additional Inherited Members

Public Types inherited from nix::fetchers::Cache
using Domain = std::string_view
using Key = std::pair<Domain, Attrs>

Member Function Documentation

◆ anchor()

void nix::fetchers::CacheImpl::anchor ( )
overridevirtual

Reimplemented from nix::fetchers::Cache.

◆ lookup()

std::optional< Attrs > nix::fetchers::CacheImpl::lookup ( const Key & key)
inlineoverridevirtual

Look up a key with infinite TTL.

Implements nix::fetchers::Cache.

◆ lookupExpired()

std::optional< Result > nix::fetchers::CacheImpl::lookupExpired ( const Key & key)
inlineoverridevirtual

Look up a key. Return a bool denoting whether its TTL has exceeded settings.tarballTTL.

Implements nix::fetchers::Cache.

◆ lookupStorePath()

std::optional< ResultWithStorePath > nix::fetchers::CacheImpl::lookupStorePath ( Key key,
Store & store )
inlineoverridevirtual

Look up a store path in the cache. The returned store path will be valid, but it may be expired.

Implements nix::fetchers::Cache.

◆ lookupStorePathWithTTL()

std::optional< ResultWithStorePath > nix::fetchers::CacheImpl::lookupStorePathWithTTL ( Key key,
Store & store )
inlineoverridevirtual

Look up a store path in the cache. Return nothing if its TTL has exceeded settings.tarballTTL.

Implements nix::fetchers::Cache.

◆ lookupWithTTL()

std::optional< Attrs > nix::fetchers::CacheImpl::lookupWithTTL ( const Key & key)
inlineoverridevirtual

Look up a key. Return nothing if its TTL has exceeded settings.tarballTTL.

Implements nix::fetchers::Cache.

◆ upsert() [1/2]

void nix::fetchers::CacheImpl::upsert ( const Key & key,
const Attrs & value )
inlineoverridevirtual

Add a key/value pair to the cache.

Implements nix::fetchers::Cache.

◆ upsert() [2/2]

void nix::fetchers::CacheImpl::upsert ( Key key,
Store & store,
Attrs value,
const StorePath & storePath )
inlineoverridevirtual

Insert a cache entry that has a store path associated with it. Such cache entries are always considered stale if the associated store path is invalid.

Implements nix::fetchers::Cache.

Member Data Documentation

◆ settings

const Settings& nix::fetchers::CacheImpl::settings

This is a back-reference to the Settings that owns us.


The documentation for this struct was generated from the following file:
  • libfetchers/cache.cc