Public unit function to create successful ``FutureResult`` objects. Is the same as :meth:`~FutureResult.from_value`. .. code:: python >>> import anyio >>> from returns.future import FutureResult, FutureSuccess >>> assert anyio.run(FutureSuccess(1).awaitable) == any
( # noqa: N802
inner_value: _NewValueType,
)
| 1473 | |
| 1474 | |
| 1475 | def FutureSuccess( # noqa: N802 |
| 1476 | inner_value: _NewValueType, |
| 1477 | ) -> FutureResult[_NewValueType, Any]: |
| 1478 | """ |
| 1479 | Public unit function to create successful ``FutureResult`` objects. |
| 1480 | |
| 1481 | Is the same as :meth:`~FutureResult.from_value`. |
| 1482 | |
| 1483 | .. code:: python |
| 1484 | |
| 1485 | >>> import anyio |
| 1486 | >>> from returns.future import FutureResult, FutureSuccess |
| 1487 | |
| 1488 | >>> assert anyio.run(FutureSuccess(1).awaitable) == anyio.run( |
| 1489 | ... FutureResult.from_value(1).awaitable, |
| 1490 | ... ) |
| 1491 | |
| 1492 | """ |
| 1493 | return FutureResult.from_value(inner_value) |
| 1494 | |
| 1495 | |
| 1496 | def FutureFailure( # noqa: N802 |