I only skimmed this, but I think you're basically talking about "I want a trait bound for closures that might or might not borrow their inputs". That's the more complicated version, this one would be
for<'any> F: FnOnce<(&'any Outer,)>,
for<'any> <F as FnOnce<(&'any Outer,)>::Output: AsRef<str>,
But you can't use FnOnce(&Outer) -> R for this because you're forced to name the return type and we don't have generic type construction parameters (or higher-kinded types or whatever). So then on stable you make your own trait with some blanket implementations etc... but probably run into heaps of inference issues and/or normalization issues.
So it's sometimes possible, but not always practical, and almost always at a cost.
but I can be suckered into writing the complicated version (or at least re-explaining it) when it comes up on this forum more often than not
↩︎