class
Amber::Schema::Failure(T)
- Amber::Schema::Failure(T)
- Reference
- Object
Overview
Failure variant containing validation errors
Defined in:
amber/schema/result.crConstructors
Instance Method Summary
- #error : ValidationFailure
- #failure? : Bool
-
#flat_map(&block : T -> Success(U) | Failure(U)) forall U
Flat map has no effect on failures
-
#map(&block : T -> U) forall U
Map has no effect on failures
- #on_failure(&block : ValidationFailure -> )
-
#on_success(&block : T -> )
Pattern matching support
-
#or_else(&block : ValidationFailure -> Success(T) | Failure(T))
Attempts to recover from the failure
- #success? : Bool
- #to_h
- #value : T | Nil
Constructor Detail
Instance Method Detail
Flat map has no effect on failures
Attempts to recover from the failure