Packages

o

kantan.codecs.resource

ResourceResult

object ResourceResult extends Simple[ResourceError]

Provides convenience methods for ResourceResult.

Source
ResourceResult.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResourceResult
  2. Simple
  3. Simple
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def close[U](u: => U): ResourceResult[Unit]

    Evaluates the specified value, returning a CloseResult if an error occurs.

    Evaluates the specified value, returning a CloseResult if an error occurs.

    Example:
    1. scala> def f: Int = sys.error("something went wrong")
      
      scala> ResourceResult.close(f)
      res0: ResourceResult[Unit] = Left(CloseError: something went wrong)
    See also

    ResourceResult.apply

  2. def failure(f: ResourceError): Either[ResourceError, Nothing]

    Turns the specified value into a failure.

    Turns the specified value into a failure.

    Definition Classes
    Simple
    Annotations
    @inline()
  3. def open[A](a: => A): ResourceResult[A]

    Evaluates the specified value, returning an OpenResult if an error occurs.

    Evaluates the specified value, returning an OpenResult if an error occurs.

    Example:
    1. scala> def f: Int = sys.error("something went wrong")
      
      scala> ResourceResult.open(f)
      res0: ResourceResult[Int] = Left(OpenError: something went wrong)
    See also

    OpenResult.apply

  4. def process[A](a: => A): ResourceResult[A]

    Evaluates the specified value, returning a ProcessResult if an error occurs.

    Evaluates the specified value, returning a ProcessResult if an error occurs.

    Example:
    1. scala> def f: Int = sys.error("something went wrong")
      
      scala> ResourceResult.process(f)
      res0: ResourceResult[Int] = Left(ProcessError: something went wrong)
    See also

    ProcessResult.apply

  5. def sequence[S, M[X] <: IterableOnce[X]](rs: M[Either[ResourceError, S]])(implicit bf: BuildFrom[M[Either[ResourceError, S]], S, M[S]]): Either[ResourceError, M[S]]

    Turns a collection of results into a result of a collection.

    Turns a collection of results into a result of a collection.

    Definition Classes
    Simple
    Annotations
    @inline()
  6. def success[S](s: S): Either[ResourceError, S]

    Turns the specified value into a success.

    Turns the specified value into a success.

    Definition Classes
    Simple
    Annotations
    @inline()