Struct TigerTuiResult<T>
The rich outcome of a TigerCli modal prompt: the exact DialogResultKind the modal
loop reported, plus the produced Value (meaningful only when the prompt completed
with Ok).
public readonly record struct TigerTuiResult<T> : IEquatable<TigerTuiResult<T>>
Type Parameters
T
- Implements
- Inherited Members
Remarks
This is the framework-internal primitive. TigerCli internals branch on ResultKind so
they can tell the cancellation flavours apart (e.g. Cancel vs
TokenCancel vs Timeout). The simple
TigerTui helpers are adapters over this type and collapse it at the outer edge (e.g. to
value-or-null), preserving their established observable behavior.Constructors
TigerTuiResult(DialogResultKind, T?)
Creates a prompt result with its exact dialog outcome and optional value.
public TigerTuiResult(DialogResultKind resultKind, T? value = default)
Parameters
resultKindDialogResultKind- The dialog result reported by the modal loop.
valueT- The value produced by a successful prompt.
Properties
IsOk
True when the prompt completed successfully (Ok).
public bool IsOk { get; }
Property Value
ResultKind
The exact dialog result kind reported by the modal loop.
public DialogResultKind ResultKind { get; }
Property Value
Value
The produced value; only meaningful when IsOk is
true.public T? Value { get; }
Property Value
- T
Methods
FromKind(DialogResultKind)
A non-success result carrying only the
kind (no value).public static TigerTuiResult<T> FromKind(DialogResultKind kind)
Parameters
kindDialogResultKind
Returns
Ok(T?)
A successful result carrying
value.public static TigerTuiResult<T> Ok(T? value)
Parameters
valueT
Returns
TryGetValue(out T?)
Returns the value via
value when IsOk; otherwise the default.public bool TryGetValue(out T? value)
Parameters
valueT