Struct ParserResult<T>
- Namespace
- Farkle
- Assembly
- Farkle.dll
Represents the result of a parsing operation. It contains a
T
in case of success or an object
in case of failure.
public readonly struct ParserResult<T> : ISpanFormattable, IFormattable
Type Parameters
T
The type of values held by successful parser results.
- Implements
- Inherited Members
Properties
Error
The ParserResult<T>'s error value.
public object? Error { get; }
Property Value
- object
An implementation-defined object that describes what went wrong with the parsing operation, or null if the parsing operation has succeeded.
IsError
Whether the ParserResult<T> represents failure.
public bool IsError { get; }
Property Value
- See Also
IsSuccess
Whether the ParserResult<T> represents success.
public bool IsSuccess { get; }
Property Value
- See Also
Value
The ParserResult<T>'s success value.
public T Value { get; }
Property Value
- T
Exceptions
Methods
ToString()
Converts the ParserResult<T>'s success or error value to a string.
public override string ToString()
Returns
ToString(string?, IFormatProvider?)
Converts the ParserResult<T>'s success or error value to a string.
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
format
stringIgnored.
formatProvider
IFormatProviderThe IFormatProvider to use to format the string.