Outcomes v0.1.0
Asking which channel a native fallible T ! E holds without unwrapping it.
Succeeded<T, E>
pub func Succeeded<T, E>(outcome: T ! E) -> bool
Whether outcome holds a success.
outcome is consumed; its payload is destroyed after the question is answered. Runs in constant time and
allocates nothing.
Type parameters
| Name | Description |
|---|---|
T | the success type |
E | the error type |
Parameters
| Name | Type | Description |
|---|---|---|
outcome | T ! E | the fallible to ask |
Returns: whether it holds a success
Failed<T, E>
pub func Failed<T, E>(outcome: T ! E) -> bool
Whether outcome holds a failure.
outcome is consumed; its payload is destroyed after the question is answered. Runs in constant time and
allocates nothing.
Type parameters
| Name | Description |
|---|---|
T | the success type |
E | the error type |
Parameters
| Name | Type | Description |
|---|---|---|
outcome | T ! E | the fallible to ask |
Returns: whether it holds a failure