Futureizer

org.scalactic.FutureSugar.Futureizer
implicit class Futureizer[T](theFuture: Future[T])

Implicit class that adds a validation method to Future, which takes one or more functions that validate the Future's value.

See the main documentation for trait `FutureSugar` for more detail and examples.

Value parameters

theFuture

the Future to which to add a validating method.

Attributes

Source
FutureSugar.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def validating(first: T => Validation[ErrorMessage], rest: T => Validation[ErrorMessage]*)(implicit executor: ExecutionContext): Future[T]

Validates a Future using the passed validation functions.

Validates a Future using the passed validation functions.

See the main documentation for trait `FutureSugar` for more detail and examples.

Value parameters

first

the first validation function to apply

rest

the subsequent validation functions to apply, if any

Attributes

Returns

a "validated" Future, either a Future with the same value, or if validation failed, a failed Future containing a ValidationFailedException.

Source
FutureSugar.scala