Struct EvalResult
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Evaluation
- Assembly
- HiMech.dll
Outcome of evaluating an NcExpr. Either a successful numeric value, or a failure with an error code matching the diagnostic catalogue used by reading / evaluator syntaxes.
public readonly record struct EvalResult : IEquatable<EvalResult>
- Implements
- Inherited Members
- Extension Methods
Constructors
EvalResult(double?, string, string)
Outcome of evaluating an NcExpr. Either a successful numeric value, or a failure with an error code matching the diagnostic catalogue used by reading / evaluator syntaxes.
public EvalResult(double? Value, string ErrorCode, string ErrorMessage)
Parameters
Properties
ErrorCode
public string ErrorCode { get; init; }
Property Value
ErrorMessage
public string ErrorMessage { get; init; }
Property Value
IsSuccess
true when ErrorCode is null.
public bool IsSuccess { get; }
Property Value
Value
public double? Value { get; init; }
Property Value
Methods
Failure(string, string)
Failed evaluation with a diagnostic code and message.
public static EvalResult Failure(string errorCode, string errorMessage)
Parameters
Returns
Success(double)
Successful evaluation.
public static EvalResult Success(double value)
Parameters
valuedouble