Attempt

object Attempt

Companion for Attempt.

Companion for Attempt.

Companion
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

case class Failure(cause: Err) extends Attempt[Nothing]

Failed attempt.

Failed attempt.

case class Successful[A](value: A) extends Attempt[A]

Successful attempt.

Successful attempt.

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Concrete methods

def failure[A](err: Err): Attempt[A]

Creates an unsuccessful attempt.

Creates an unsuccessful attempt.

def fromEither[A](e: Either[Err, A]): Attempt[A]

Creates an attempt from the supplied either.

Creates an attempt from the supplied either.

def fromErrOption[A](opt: Option[Err], ifNone: => A): Attempt[A]

Creates an attempt from the supplied option. The ifNone value is used as the success value if opt is None.

Creates an attempt from the supplied option. The ifNone value is used as the success value if opt is None.

def fromOption[A](opt: Option[A], ifNone: => Err): Attempt[A]

Creates an attempt from the supplied option. The ifNone value is used as the error message if opt is None.

Creates an attempt from the supplied option. The ifNone value is used as the error message if opt is None.

def fromTry[A](t: Try[A]): Attempt[A]

Creates a attempt from a try.

Creates a attempt from a try.

def guard(condition: => Boolean, err: String): Attempt[Unit]

Creates a successful attempt if the condition succeeds otherwise create a unsuccessful attempt.

Creates a successful attempt if the condition succeeds otherwise create a unsuccessful attempt.

def guard(condition: => Boolean, err: => Err): Attempt[Unit]

Creates a successful attempt if the condition succeeds otherwise create a unsuccessful attempt.

Creates a successful attempt if the condition succeeds otherwise create a unsuccessful attempt.

def successful[A](a: A): Attempt[A]

Creates a successful attempt.

Creates a successful attempt.