![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <bit>#include <cassert>#include <cstddef>#include <cstring>#include <memory>#include <memory_resource>#include <exception>#include <span>#include <string_view>#include <type_traits>#include <concepts>#include "nix/expr/eval-gc.hh"#include "nix/expr/value/context.hh"#include "nix/util/source-path.hh"#include "nix/expr/print-options.hh"#include "nix/util/checked-arithmetic.hh"#include "nix/util/pos-idx.hh"#include <boost/unordered/unordered_flat_map_fwd.hpp>#include <nlohmann/json_fwd.hpp>Go to the source code of this file.
Macros | |
| #define | NIX_VALUE_STORAGE_FOR_EACH_FIELD(MACRO) |
| #define | NIX_VALUE_PAYLOAD_TYPE(T, FIELD_NAME, DISCRIMINATOR) |
| #define | NIX_VALUE_STORAGE_DEFINE_FIELD(T, FIELD_NAME, DISCRIMINATOR) |
| #define | NIX_VALUE_STORAGE_GET_IMPL(K, FIELD_NAME, DISCRIMINATOR) |
| #define | NIX_VALUE_STORAGE_SET_IMPL(K, FIELD_NAME, DISCRIMINATOR) |
| #define | NIX_VALUE_STORAGE_DEF_PAIR_OF_PTRS(TYPE, MEMBER_A, MEMBER_B) |
Typedefs | |
| using | nix::NixInt = checked::Checked<int64_t> |
| using | nix::NixFloat = double |
| typedef std::vector< Value *, traceable_allocator< Value * > > | nix::ValueVector |
| typedef boost::unordered_flat_map< Symbol, Value *, std::hash< Symbol >, std::equal_to< Symbol >, traceable_allocator< std::pair< const Symbol, Value * > > > | nix::ValueMap |
| typedef std::map< Symbol, ValueVector, std::less< Symbol >, traceable_allocator< std::pair< const Symbol, ValueVector > > > | nix::ValueVectorMap |
| typedef std::shared_ptr< Value * > | nix::RootValue |
Enumerations | |
| enum | nix::InternalType { tUninitialized = 0 , tInt = 1 , tBool , tNull , tFloat , tFailed , tExternal , tPrimOp , tAttrs , tFirstPairOfPointers , tListSmall = tFirstPairOfPointers , tString , tPath , tPrimOpApp , tApp , tThunk , tLambda , tLastPairOfPointers = tLambda , tFirstSingleUntaggable , tListN = tFirstSingleUntaggable , tSymbol , tNumberOfInternalTypes } |
| enum | nix::ValueType { nThunk , nFailed , nInt , nFloat , nBool , nString , nPath , nNull , nAttrs , nList , nFunction , nExternal } |
Functions | |
| std::ostream & | nix::operator<< (std::ostream &str, const ExternalValueBase &v) |
| RootValue | nix::allocRootValue (Value *v) |
| void | nix::throwNullByteError (std::string_view s, const PosTable *positions, PosIdx pos) |
| void | nix::forceNoNullByte (std::string_view s, const PosTable *positions=nullptr, PosIdx pos=noPos) |
Variables | |
| template<typename T> | |
| constexpr InternalType | nix::detail::payloadTypeToInternalType = PayloadTypeToInternalType<T>::value |
| template<std::size_t ptrSize> | |
| constexpr bool | nix::detail::useBitPackedValueStorage = (ptrSize == 8) && (__STDCPP_DEFAULT_NEW_ALIGNMENT__ >= 16) |
| #define NIX_VALUE_PAYLOAD_TYPE | ( | T, | |
| FIELD_NAME, | |||
| DISCRIMINATOR ) |
| #define NIX_VALUE_STORAGE_DEF_PAIR_OF_PTRS | ( | TYPE, | |
| MEMBER_A, | |||
| MEMBER_B ) |
| #define NIX_VALUE_STORAGE_DEFINE_FIELD | ( | T, | |
| FIELD_NAME, | |||
| DISCRIMINATOR ) |
| #define NIX_VALUE_STORAGE_FOR_EACH_FIELD | ( | MACRO | ) |
All stored types must be distinct (not type aliases) for the purposes of overload resolution in setStorage. This ensures there's a bijection from InternalType <-> C++ type.
| #define NIX_VALUE_STORAGE_GET_IMPL | ( | K, | |
| FIELD_NAME, | |||
| DISCRIMINATOR ) |
| #define NIX_VALUE_STORAGE_SET_IMPL | ( | K, | |
| FIELD_NAME, | |||
| DISCRIMINATOR ) |
| typedef std::shared_ptr<Value *> nix::RootValue |
A value allocated in traceable memory.
| enum nix::InternalType |
Internal type discriminator, which is more detailed than ValueType, as it specifies the exact representation used (for types that have multiple possible representations).
| enum nix::ValueType |
This type abstracts over all actual value types in the language, grouping together implementation details like tList*, different function types, and types in non-normal form (so thunks and co.)
|
inline |
Throws if s contains a null byte, which is not supported by the whole codebase yet. If positions is given, the error points at pos. The position is only resolved if the check fails.