Futureizer
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
Futureto which to add avalidatingmethod.
- Source:
- FutureSugar.scala
class Object
trait Matchable
class Any
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
- Returns:
a "validated"
Future, either aFuturewith the same value, or if validation failed, a failedFuturecontaining aValidationFailedException.- Source:
- FutureSugar.scala