opaque type
A return type the caller knows only by the traits it implements.
An opaque type (impl Trait in return position) is one concrete type chosen by the function and hidden from callers, who may use only the named traits.
Examples
fn evens() -> impl Iterator<Item = u32> { (0..10).filter(|n| n % 2 == 0) }hides the longFilter<..>type; callers can only use the result as an iterator.
See also