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
Future
to which to add avalidating
method.
- 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 aFuture
with the same value, or if validation failed, a failedFuture
containing aValidationFailedException
.- Source:
- FutureSugar.scala