ResourceResult
kantan.codecs.resource.ResourceResult
object ResourceResult extends Simple[ResourceError]
Provides convenience methods for ResourceResult.
Attributes
- Graph
-
- Supertypes
- Self type
-
ResourceResult.type
Members list
Value members
Concrete methods
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)
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)
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.
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 the specified value into a success.
In this article