Skip to content

Releases: alice-biometrics/meiga

v1.1.0

21 Jan 10:21
Compare
Choose a tag to compare
  • 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

20 Jan 08:32
Compare
Choose a tag to compare
  • 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_successfunction 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

09 Jan 17:19
b4c6951
Compare
Choose a tag to compare
Update setup.py

v0.1.3

19 Dec 14:52
ba96f4c
Compare
Choose a tag to compare
Merge pull request #5 from alice-biometrics/release/0.1.3

Release/0.1.3

v0.1.2

18 Dec 11:49
Compare
Choose a tag to compare
Added success_handler and failure_handler when unwrap values with Res…

v0.1.1

24 Sep 17:29
054c000
Compare
Choose a tag to compare

Added useful alias