Failure

class Failure[Err] extends Result[Err, Nothing] with Product with Serializable

Returned on parsing failure

Returned on parsing failure

Value Params
msg

The error message reported by the parser

Companion
object
trait Serializable
trait Product
trait Equals
trait Result[Err, Nothing]
class Object
trait Matchable
class Any

Value members

Concrete methods

override def canEqual(x: Any): Boolean
Definition Classes
Equals
def copy(msg: => Err): Failure[Err]
override def equals(x: Any): Boolean
Definition Classes
Equals -> Any
override def get: Nothing
Definition Classes
override def hashCode: Int
Definition Classes
Any
override def isFailure: Boolean
Definition Classes
override def isSuccess: Boolean
Definition Classes
override def productArity: Int
Definition Classes
Product
override def productElement(idx: Int): Any
Definition Classes
Product
override def productPrefix: String
Definition Classes
Product
override def toString: String
Definition Classes
Any

Inherited methods

final def contains[B](elem: B): Boolean

Returns true if this is a Success and its value is equal to elem (as determined by ==), returns false otherwise.

Returns true if this is a Success and its value is equal to elem (as determined by ==), returns false otherwise.

Value Params
elem

the element to test.

Returns

true if this is a Success value equal to elem.

Since

1.7.0

Inherited from
Result
def exists(p: Nothing => Boolean): Boolean

Returns false if Failure or returns the result of the application of the given predicate to the Success value.

Returns false if Failure or returns the result of the application of the given predicate to the Success value.

Since

1.7.0

Inherited from
Result
def filterOrElse[Err_ >: Err](p: Nothing => Boolean, msg: => Err_): Result[Err_, Nothing]

Returns Success with the existing value of Success if this is a Success and the given predicate p holds for the right value, or Failure(msg) if this is a Success and the given predicate p does not hold for the right value, or Failure with the existing value of Failure if this is a Failure.

Returns Success with the existing value of Success if this is a Success and the given predicate p holds for the right value, or Failure(msg) if this is a Success and the given predicate p does not hold for the right value, or Failure with the existing value of Failure if this is a Failure.

Since

1.7.0

Inherited from
Result
def flatMap[B, Err_ >: Err](f: Nothing => Result[Err_, B]): Result[Err_, B]

Binds the given function across Success.

Binds the given function across Success.

Value Params
f

The function to bind across Success.

Since

1.7.0

Inherited from
Result
def flatten[B, Err_ >: Err](ev: Nothing <:< Result[Err_, B]): Result[Err_, B]

Returns the right value if this is right or this value if this is left

Returns the right value if this is right or this value if this is left

Equivalent to flatMap(id => id)

Since

1.7.0

Inherited from
Result
def fold[B](ferr: Err => B, fa: Nothing => B): B

Applies fa if this is a Failure or fb if this is a Success.

Applies fa if this is a Failure or fb if this is a Success.

Value Params
fa

the function to apply if this is a Success

ferr

the function to apply if this is a Failure

Returns

the results of applying the function

Since

1.7.0

Inherited from
Result
def forall(f: Nothing => Boolean): Boolean

Returns true if Failure or returns the result of the application of the given predicate to the Success value.

Returns true if Failure or returns the result of the application of the given predicate to the Success value.

Since

1.7.0

Inherited from
Result
def foreach[U](f: Nothing => U): Unit

Executes the given side-effecting function if this is a Success.

Executes the given side-effecting function if this is a Success.

Value Params
f

The side-effecting function to execute.

Since

1.7.0

Inherited from
Result
def getOrElse[B](or: => B): B

Returns the value from this Success or the given argument if this is a Failure.

Returns the value from this Success or the given argument if this is a Failure.

Since

1.7.0

Inherited from
Result
def map[B](f: Nothing => B): Result[Err, B]

The given function is applied if this is a Success.

The given function is applied if this is a Success.

Since

1.7.0

Inherited from
Result
def orElse[B, Err_ >: Err](or: => Result[Err_, B]): Result[Err_, B]

Returns this Success or the given argument if this is a Failure.

Returns this Success or the given argument if this is a Failure.

Since

1.7.0

Inherited from
Result
def productElementName(n: Int): String
Inherited from
Product
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def toEither: Either[Err, Nothing]

Converts the Result into a Either where Failure maps to a Left[Err]

Converts the Result into a Either where Failure maps to a Left[Err]

Since

1.7.0

Inherited from
Result
def toOption: Option[Nothing]

Returns a Some containing the Success value if it exists or a None if this is a Failure.

Returns a Some containing the Success value if it exists or a None if this is a Failure.

Since

1.7.0

Inherited from
Result
def toSeq: Seq[Nothing]

Returns a Seq containing the Success value if it exists or an empty Seq if this is a Failure.

Returns a Seq containing the Success value if it exists or an empty Seq if this is a Failure.

Since

1.7.0

Inherited from
Result
def toTry: Try[Nothing]

Converts the Result into a Try where Failure maps to a plain Exception

Converts the Result into a Try where Failure maps to a plain Exception

Since

1.7.0

Inherited from
Result

Concrete fields

lazy val msg: Err