Nix
2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
store-cast.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
lix/libstore/store-api.hh
"
5
6
namespace
nix {
7
15
template
<
typename
T>
16
T &
require
(
Store
& store)
17
{
18
auto
* castedStore =
dynamic_cast<
T *
>
(&store);
19
if
(!castedStore)
20
throw
UsageError(
"%s not supported by store '%s'"
, T::operationName, store.getUri());
21
return
*castedStore;
22
}
23
24
}
nix::Store
Definition
store-api.hh:195
store-api.hh
nix::require
T & require(Store &store)
Definition
store-cast.hh:16
lix
libstore
store-cast.hh
Generated by
1.15.0