when method
void
when({})
override
Calls success
if this is a Success
, or failure
if this is a Failure
.
Success('s').when(success: print); // 's'
Failure('f').when(success: print); // nothing
Implementation
@override
void when({Consume<S> success = Result._nothing, Consume<F> failure = Result._nothing}) => failure(this.failure);