Allows to create a ``Future`` from ``IO`` container. .. code:: python >>> import anyio >>> from returns.future import Future >>> from returns.io import IO >>> async def main() -> bool: ... return (await Future.from_io(IO(1))) =
(cls, inner_value: IO[_NewValueType])
| 426 | |
| 427 | @classmethod |
| 428 | def from_io(cls, inner_value: IO[_NewValueType]) -> 'Future[_NewValueType]': |
| 429 | """ |
| 430 | Allows to create a ``Future`` from ``IO`` container. |
| 431 | |
| 432 | .. code:: python |
| 433 | |
| 434 | >>> import anyio |
| 435 | >>> from returns.future import Future |
| 436 | >>> from returns.io import IO |
| 437 | |
| 438 | >>> async def main() -> bool: |
| 439 | ... return (await Future.from_io(IO(1))) == IO(1) |
| 440 | |
| 441 | >>> assert anyio.run(main) is True |
| 442 | |
| 443 | """ |
| 444 | return Future(async_identity(inner_value._inner_value)) # noqa: SLF001 |
| 445 | |
| 446 | @classmethod |
| 447 | def from_future_result( |
nothing calls this directly
no test coverage detected