Releases: alice-biometrics/meiga
Releases · alice-biometrics/meiga
v1.1.0
-
Added
unwrap_and
-
Refactored
handle
. Now it returns itself.def on_success(value): print(f"on_success: {value}") def on_failure(value): print(f"on_failure: {value}") result = Success("Hi!") value = result.handle(on_success, on_failure).unwrap()
v1.0.0
- Functions refactor and stabilization
Properties
Properties | Definition |
---|---|
value |
Returns the encapsulated value whether it's success or failure |
is_success |
Returns true if this instance represents successful outcome. In this case is_failure returns false. |
is_failure |
Returns true if this instance represents failed outcome. In this case is_success returns false |
Functions
Functions | Definition |
---|---|
unwrap() |
Returns the encapsulated value if this instance represents success or None if it is failure. |
unwrap_or(failure_value) |
Returns the encapsulated value if this instance represents success or the selected failure_value if it is failure. |
unwrap_or_throw() |
Returns the encapsulated value if this instance represents success or throws the encapsulated exception if it is failure. |
unwrap_or_else(on_failure) |
Returns the encapsulated value if this instance represents success or execute the on_failure function when it is failure. |
handle(on_success,on_failure) |
Returns itself and execute the on_success function when the instance represemts success and the on_failure function when it is failure. |
map(transform) |
Returns a transformed result applying transform function applied to encapsulated value if this instance represents success or failure |
v0.1.4
Update setup.py
v0.1.3
Merge pull request #5 from alice-biometrics/release/0.1.3 Release/0.1.3
v0.1.2
Added success_handler and failure_handler when unwrap values with Res…
v0.1.1
Added useful alias