scottmcm · GitHub

Feature gate: #![feature(try_trait_v2_residual)]

This is a tracking issue for the ops::Residual trait. cc rust-lang/rfcs#3721

This is used by try_* APIs that need to change from one member of a family to another, such as

For example, the closure passed to Iterator::try_find returns Foo<bool>, but the method wants to be able to return Foo<Option<<Self as Iterator>::Item>>.

Public API

// ops::Residual
trait Residual<O> {
    type TryTrait: Try<Output = O, Residual = Self>;
}
// with implementations for `Result`, `Option`, and `ControlFlow`.

Steps / History

Unresolved Questions

Read the original on github.com ↗