Result<R> class Null safety

An immutable parse result.

Inheritance
Implementers

Constructors

Result(String buffer, int position)
const

Properties

buffer String
The buffer we are working on.
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isFailure bool
Returns true if this result indicates a parse failure.
read-only
isSuccess bool
Returns true if this result indicates a parse success.
read-only
message String
Returns the error message of this result, or throws an UnsupportedError if this is a parse success.
read-only
position int
The current position in the buffer.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value → R
Returns the parsed value of this result, or throws a ParserException if this is a parse failure.
read-only

Methods

failure<R>(String message, [int? position]) Failure<R>
Returns a result indicating a parse failure.
@inlineJs, @inlineVm, inherited
map<T>(T callback(R element)) Result<T>
Transforms the result with a callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
success<R>(R result, [int? position]) Success<R>
Returns a result indicating a parse success.
@inlineJs, @inlineVm, inherited
toPositionString() String
Returns the current line:column position in the buffer.
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited