Exit

sealed abstract class Exit[+E, +A] extends Product with Serializable

An Exit[E, A] describes the result of executing an IO value. The result is either succeeded with a value A, or failed with a Cause[E].

Companion:
object
trait Product
trait Equals
class Object
trait Matchable
class Any
class Failure[E]
class Success[A]
Exit[E, A]

Value members

Concrete methods

final def &>[E1 >: E, B](that: Exit[E1, B]): Exit[E1, B]

Parallelly zips the this result with the specified result discarding the first element of the tuple or else returns the failed Cause[E1]

Parallelly zips the this result with the specified result discarding the first element of the tuple or else returns the failed Cause[E1]

final def *>[E1 >: E, B](that: Exit[E1, B]): Exit[E1, B]

Sequentially zips the this result with the specified result discarding the first element of the tuple or else returns the failed Cause[E1]

Sequentially zips the this result with the specified result discarding the first element of the tuple or else returns the failed Cause[E1]

final def <&[E1 >: E, B](that: Exit[E1, B]): Exit[E1, A]

Parallelly zips the this result with the specified result discarding the second element of the tuple or else returns the failed Cause[E1]

Parallelly zips the this result with the specified result discarding the second element of the tuple or else returns the failed Cause[E1]

final def <&>[E1 >: E, B](that: Exit[E1, B]): Exit[E1, (A, B)]

Parallelly zips the this result with the specified result or else returns the failed Cause[E1]

Parallelly zips the this result with the specified result or else returns the failed Cause[E1]

final def <*[E1 >: E, B](that: Exit[E1, B]): Exit[E1, A]

Sequentially zips the this result with the specified result discarding the second element of the tuple or else returns the failed Cause[E1]

Sequentially zips the this result with the specified result discarding the second element of the tuple or else returns the failed Cause[E1]

final def <*>[E1 >: E, B](that: Exit[E1, B]): Exit[E1, (A, B)]

Sequentially zips the this result with the specified result or else returns the failed Cause[E1]

Sequentially zips the this result with the specified result or else returns the failed Cause[E1]

final def as[B](b: B): Exit[E, B]

Replaces the success value with the one provided.

Replaces the success value with the one provided.

final def exists(p: A => Boolean): Boolean
final def flatMap[E1 >: E, A1](f: A => Exit[E1, A1]): Exit[E1, A1]

Flat maps over the value type.

Flat maps over the value type.

final def flatMapM[E1 >: E, R, E2, A1](f: A => ZIO[R, E2, Exit[E1, A1]]): ZIO[R, E2, Exit[E1, A1]]

Flat maps over the value type.

Flat maps over the value type.

final def flatten[E1 >: E, B](implicit ev: A <:< Exit[E1, B]): Exit[E1, B]
final def fold[Z](failed: Cause[E] => Z, completed: A => Z): Z

Folds over the value or cause.

Folds over the value or cause.

final def foldM[R, E1, B](failed: Cause[E] => ZIO[R, E1, B], completed: A => ZIO[R, E1, B]): ZIO[R, E1, B]

Sequentially zips the this result with the specified result or else returns the failed Cause[E1]

Sequentially zips the this result with the specified result or else returns the failed Cause[E1]

final def foreach[R, E1 >: E, B](f: A => ZIO[R, E1, B]): ZIO[R, Nothing, Exit[E1, B]]

Applies the function f to the successful result of the Exit and returns the result in a new Exit.

Applies the function f to the successful result of the Exit and returns the result in a new Exit.

final def getOrElse[A1 >: A](orElse: Cause[E] => A1): A1

Retrieves the A if succeeded, or else returns the specified default A.

Retrieves the A if succeeded, or else returns the specified default A.

final def interrupted: Boolean

Determines if the result is interrupted.

Determines if the result is interrupted.

final def map[A1](f: A => A1): Exit[E, A1]

Maps over the value type.

Maps over the value type.

final def mapBoth[E1, A1](f: E => E1, g: A => A1): Exit[E1, A1]

Maps over both the error and value type.

Maps over both the error and value type.

final def mapError[E1](f: E => E1): Exit[E1, A]

Maps over the error type.

Maps over the error type.

final def mapErrorCause[E1](f: Cause[E] => Cause[E1]): Exit[E1, A]

Maps over the cause type.

Maps over the cause type.

final def orElseFail[E1](e1: => E1): Exit[E1, A]

Replaces the error value with the one provided.

Replaces the error value with the one provided.

final def succeeded: Boolean

Determines if the result is a success.

Determines if the result is a success.

final def toEither: Either[Throwable, A]

Converts the Exit to an Either[Throwable, A], by wrapping the cause in FiberFailure (if the result is failed).

Converts the Exit to an Either[Throwable, A], by wrapping the cause in FiberFailure (if the result is failed).

final def unit: Exit[E, Unit]

Discards the value.

Discards the value.

final def untraced: Exit[E, A]

Returns an untraced exit value.

Returns an untraced exit value.

final def zip[E1 >: E, B](that: Exit[E1, B]): Exit[E1, (A, B)]

Named alias for <*>.

Named alias for <*>.

final def zipLeft[E1 >: E, B](that: Exit[E1, B]): Exit[E1, A]

Named alias for <*.

Named alias for <*.

final def zipPar[E1 >: E, B](that: Exit[E1, B]): Exit[E1, (A, B)]

Named alias for <&>.

Named alias for <&>.

final def zipParLeft[E1 >: E, B](that: Exit[E1, B]): Exit[E1, A]

Named alias for <&.

Named alias for <&.

final def zipParRight[E1 >: E, B](that: Exit[E1, B]): Exit[E1, B]

Named alias for &>.

Named alias for &>.

final def zipRight[E1 >: E, B](that: Exit[E1, B]): Exit[E1, B]

Named alias for *>.

Named alias for *>.

final def zipWith[E1 >: E, B, C](that: Exit[E1, B])(f: (A, B) => C, g: (Cause[E], Cause[E1]) => Cause[E1]): Exit[E1, C]

Zips this together with the specified result using the combination functions.

Zips this together with the specified result using the combination functions.

Deprecated methods

@deprecated("use mapBoth", "2.0.0")
final def bimap[E1, A1](f: E => E1, g: A => A1): Exit[E1, A1]

Maps over both the error and value type.

Maps over both the error and value type.

Deprecated

Inherited methods

def canEqual(that: Any): Boolean
Inherited from:
Equals
Inherited from:
Product
def productElement(n: Int): Any
Inherited from:
Product
Inherited from:
Product
Inherited from:
Product
Inherited from:
Product