feat: add Result.FailureVal and Result.SuccessVal
This commit is contained in:
parent
a5a7c312e3
commit
35cc366856
|
@ -22,6 +22,10 @@ public readonly struct Result<TSuccess, TFailure>
|
||||||
public bool IsSuccess => _successVal.HasValue;
|
public bool IsSuccess => _successVal.HasValue;
|
||||||
public bool IsFailure => _failureVal.HasValue;
|
public bool IsFailure => _failureVal.HasValue;
|
||||||
|
|
||||||
|
public TSuccess SuccessVal => _successVal.Value;
|
||||||
|
|
||||||
|
public TFailure FailureVal => _failureVal.Value;
|
||||||
|
|
||||||
public bool TrySuccess(out TSuccess output)
|
public bool TrySuccess(out TSuccess output)
|
||||||
{
|
{
|
||||||
if (!_successVal.Try(out output))
|
if (!_successVal.Try(out output))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user