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

Classes

struct  Success

Public Types

using Failure = BuildError

Public Member Functions

auto * tryGetSuccess (this auto &self)
auto * tryGetFailure (this auto &self)
void tryThrowBuildError (std::optional< unsigned int > exitStatus=std::nullopt)
bool operator== (const BuildResult &) const noexcept
std::strong_ordering operator<=> (const BuildResult &) const noexcept

Public Attributes

std::variant< Success, Failure > inner = Failure{}
unsigned int timesBuilt = 0
time_t startTime = 0
time_t stopTime = 0
std::optional< std::chrono::microseconds > cpuUser
std::optional< std::chrono::microseconds > cpuSystem

Member Typedef Documentation

◆ Failure

Member Function Documentation

◆ tryGetFailure()

auto * nix::BuildResult::tryGetFailure ( this auto & self)
inline

Convenience wrapper to avoid a longer std::get_if usage by the caller (which will have to add more BuildResult:: than we do below also, do note.)

◆ tryGetSuccess()

auto * nix::BuildResult::tryGetSuccess ( this auto & self)
inline

Convenience wrapper to avoid a longer std::get_if usage by the caller (which will have to add more BuildResult:: than we do below also, do note.)

◆ tryThrowBuildError()

void nix::BuildResult::tryThrowBuildError ( std::optional< unsigned int > exitStatus = std::nullopt)
inline

Throw the build error if this result represents a failure. Optionally set the exit status on the error before throwing.

Member Data Documentation

◆ cpuUser

std::optional<std::chrono::microseconds> nix::BuildResult::cpuUser

User and system CPU time the build took.

◆ startTime

time_t nix::BuildResult::startTime = 0

The start/stop times of the build (or one of the rounds, if it was repeated).

◆ timesBuilt

unsigned int nix::BuildResult::timesBuilt = 0

How many times this build was performed.


The documentation for this struct was generated from the following files: