Public unit function to create failed ``FutureResult`` objects. Is the same as :meth:`~FutureResult.from_failure`. .. code:: python >>> import anyio >>> from returns.future import FutureResult, FutureFailure >>> assert anyio.run(FutureFailure(1).awaitable) == anyio
( # noqa: N802
inner_value: _NewErrorType,
)
| 1494 | |
| 1495 | |
| 1496 | def FutureFailure( # noqa: N802 |
| 1497 | inner_value: _NewErrorType, |
| 1498 | ) -> FutureResult[Any, _NewErrorType]: |
| 1499 | """ |
| 1500 | Public unit function to create failed ``FutureResult`` objects. |
| 1501 | |
| 1502 | Is the same as :meth:`~FutureResult.from_failure`. |
| 1503 | |
| 1504 | .. code:: python |
| 1505 | |
| 1506 | >>> import anyio |
| 1507 | >>> from returns.future import FutureResult, FutureFailure |
| 1508 | |
| 1509 | >>> assert anyio.run(FutureFailure(1).awaitable) == anyio.run( |
| 1510 | ... FutureResult.from_failure(1).awaitable, |
| 1511 | ... ) |
| 1512 | |
| 1513 | """ |
| 1514 | return FutureResult.from_failure(inner_value) |
| 1515 | |
| 1516 | |
| 1517 | #: Alias for ``FutureResult[_ValueType_co, Exception]``. |