Attempt

scodec.Attempt$
See theAttempt companion class
object Attempt

Companion for Attempt.

Attributes

Companion:
class
Source:
Attempt.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Attempt.type

Members list

Concise view

Type members

Classlikes

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

Failed attempt.

Failed attempt.

Attributes

Source:
Attempt.scala
Graph
Supertypes
class Attempt[Nothing]
trait Product
trait Equals
class Object
trait Matchable
class Any
case class Successful[A](value: A) extends Attempt[A]

Successful attempt.

Successful attempt.

Attributes

Source:
Attempt.scala
Graph
Supertypes
class Attempt[A]
trait Product
trait Equals
class Object
trait Matchable
class Any

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source:
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

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

Creates an unsuccessful attempt.

Creates an unsuccessful attempt.

Attributes

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

Creates an attempt from the supplied either.

Creates an attempt from the supplied either.

Attributes

Source:
Attempt.scala
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.

Attributes

Source:
Attempt.scala
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.

Attributes

Source:
Attempt.scala
def fromTry[A](t: Try[A]): Attempt[A]

Creates a attempt from a try.

Creates a attempt from a try.

Attributes

Source:
Attempt.scala
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.

Attributes

Source:
Attempt.scala
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.

Attributes

Source:
Attempt.scala
def successful[A](a: A): Attempt[A]

Creates a successful attempt.

Creates a successful attempt.

Attributes

Source:
Attempt.scala