ScalaConverters

steps.result.ScalaConverters

Provides extension methods convert Scala API optional value containers into Result.

By default, Result already provides conversions back into these containers through Result.ok, Result.toEither and Result.toTry.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Extensions

Extensions

extension [E, T](either: Either[E, T])
def asResult: Result[T, E]

Converts an Either[E, T] into a Result[T, E]. Note that the types are reversed in order.

Converts an Either[E, T] into a Result[T, E]. Note that the types are reversed in order.

Attributes

extension [T](op: Option[T])
def okOr[E](error: => E): Result[T, E]

Converts an Option[T] into a Result[T, E] by providing an error for the None case.

Converts an Option[T] into a Result[T, E] by providing an error for the None case.

Attributes

extension [T](t: Try[T])
def asResult: Result[T, Throwable]

Converts a Try[T] into a Result[T, Throwable].

Converts a Try[T] into a Result[T, Throwable].

Attributes