Result<T>

References
public sealed class Result<T> : IResult
The result of a parsing operation.
T

Properties

After

#
Gets the index within the source string where the substring for this parse ends, or in the case of a failed parse where the error block ends.
public int After { get; }
After

Error

#
Failure in case of a unsuccessful parse.
public string Error { get; }
Error
Explicit

IResult.Value

#
Value

Start

#
Gets the index within the source string where the substring for this parse starts, or in he case of a failed parse where the error block starts.
public int Start { get; }
Start

Success

#
Gets whether the parsing was successful.
public bool Success { get; }
Success

Text

#
Gets the substring indicated by this result.
public string Text { get; }
Text

Underlying

#
public string Underlying { get; }

Value

#
Gets the value associated with this result. Only meaningful when Success is true.
public T Value { get; }

Methods

Fail

#
Create a new failed parsing result.
public static Result<T> Fail(
error,
Error message.
underlying,
The underlying string which was parsed.
start = 0,
Index of first character.
after = 2147483647
Index of first character after span.
)

Succeed

#
Create a new successful parsing result.
public static Result<T> Succeed(
T
value,
Value of parsing result.
underlying,
The underlying string which was parsed.
start = 0,
Index of first character.
after = 2147483647
Index of character after span.
)

WithValue<Q>

#
Create a new result with the same coverage but a different value.
public Result<Q> WithValue<Q>(
Q
newValue
)
WithValue