Skip to content

Review TryFutureExt combinators #2470

@sidju

Description

@sidju

Currently there isn't a complete selection of sync/async and Result/infallible combinators in TryFutureExt.

- Result<T,E> T (auto wrapped into Result)
sync none .map_ok/.map_err
async .and_then/.or_else none

For the times when one wants to convert an Ok result into an error depending on its value or vice versa sync combinators that return Result would be nicer than using FutureExt::map and only caring about one of the cases.

Likewise when one has an async function that is infallible, such as a web handler that in the worst case renders and returns an error page to treat the same as a successful result, infallible async combinators would be very helpful. Instead of declaring returning with Ok around the return and matching the unused Error type to the TryFuture::Error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions