``IOFailure`` representation.
| 817 | |
| 818 | @final |
| 819 | class IOFailure(IOResult[Any, _ErrorType_co]): |
| 820 | """``IOFailure`` representation.""" |
| 821 | |
| 822 | __slots__ = () |
| 823 | |
| 824 | _inner_value: Result[Any, _ErrorType_co] |
| 825 | |
| 826 | def __init__(self, inner_value: _ErrorType_co) -> None: |
| 827 | """IOFailure constructor.""" |
| 828 | super().__init__(Failure(inner_value)) |
| 829 | |
| 830 | if not TYPE_CHECKING: # noqa: WPS604 # pragma: no branch |
| 831 | |
| 832 | def bind(self, function): |
| 833 | """Does nothing for ``IOFailure``.""" |
| 834 | return self |
| 835 | |
| 836 | #: Alias for `bind_ioresult` method. Part of the `IOResultBasedN` interface. # noqa: E501 |
| 837 | bind_ioresult = bind |
| 838 | |
| 839 | def bind_result(self, function): |
| 840 | """Does nothing for ``IOFailure``.""" |
| 841 | return self |
| 842 | |
| 843 | def bind_io(self, function): |
| 844 | """Does nothing for ``IOFailure``.""" |
| 845 | return self |
| 846 | |
| 847 | def lash(self, function): |
| 848 | """Composes this container with a function returning ``IOResult``.""" # noqa: E501 |
| 849 | return function(self._inner_value.failure()) |
| 850 | |
| 851 | |
| 852 | @final |
no outgoing calls