ResourceResult

kantan.codecs.resource.ResourceResult

Provides convenience methods for ResourceResult.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

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.

Attributes

See also

ResourceResult.apply

Example
scala> def f: Int = sys.error("something went wrong")
scala> ResourceResult.close(f)
res0: ResourceResult[Unit] = Left(CloseError: something went wrong)
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.

Attributes

See also

OpenResult.apply

Example
scala> def f: Int = sys.error("something went wrong")
scala> ResourceResult.open(f)
res0: ResourceResult[Int] = Left(OpenError: something went wrong)
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.

Attributes

See also

ProcessResult.apply

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

Inherited methods

Turns the specified value into a failure.

Turns the specified value into a failure.

Attributes

Inherited from:
Simple
def sequence[S, M <: (IterableOnce)](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.

Attributes

Inherited from:
Simple
def success[S](s: S): Either[ResourceError, S]

Turns the specified value into a success.

Turns the specified value into a success.

Attributes

Inherited from:
Simple