
CodecResult<T>
- Namespace
- Rowles.LeanCorpus.Codecs.CodecKit.Codecs
- Assembly
- Rowles.LeanCorpus.dll
Represents the result of a non-throwing codec operation. Access Value on success or Failure on failure. Accessing the wrong property throws InvalidOperationException.
public readonly struct CodecResult<T>
Type Parameters
T
Failure
The failure metadata. Throws InvalidOperationException if the operation succeeded.
IsFailure
True if the operation failed.
IsSuccess
True if the operation succeeded.
Value
The decoded/encoded value. Throws InvalidOperationException if the operation failed.
Fail(CodecFailure)
Creates a failed result from a CodecFailure.
Fail(CodecException)
Creates a failed result from a CodecException.
Success(T)
Creates a successful result.