ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
foresthub::agent::RunResultOrError Struct Reference

Result wrapper that holds either a RunResult or an error message. More...

#include <runner.hpp>

Public Member Functions

bool HasError () const
 Check if an error occurred.

Static Public Member Functions

static RunResultOrError Success (RunResult result)
 Create a successful result.
static RunResultOrError Failure (std::string error_message)
 Create a failure result.

Public Attributes

foresthub::Optional< RunResultresult
 Present on success.
std::string error
 Non-empty on failure.

Detailed Description

Result wrapper that holds either a RunResult or an error message.

Member Function Documentation

◆ Failure()

RunResultOrError foresthub::agent::RunResultOrError::Failure ( std::string error_message)
inlinestatic

Create a failure result.

Parameters
error_messageDescription of what went wrong.
Returns
RunResultOrError with the error message.

◆ Success()

RunResultOrError foresthub::agent::RunResultOrError::Success ( RunResult result)
inlinestatic

Create a successful result.

Parameters
resultCompleted run result to wrap.
Returns
RunResultOrError wrapping the given result.

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