Hi,
I needed an HRTB like this (not valid Rust, but I hope it can be understood):
T: for<'a where U: 'a> SomeTrait<'a>
To do so, I used an approach described in this article. It works for me, no problems there.
My question is: How to name this kind of HRTBs (e.g. in docs when explaining why some extra traits and generic parameters exist)?
So far I came up with following candidates:
- Upper bounded (based on interpretation of lifetimes as durations and that the universal quantifier ranges over short enough lifetimes)
- Lower bounded
(as the "outlives" relation is sometimes aligned with the "subtype" relation so we can pretend references are covariant, also
X: Y
is usually read in theSub: Super
direction of ordering, so the universal quantifier in the HRTB ranges over lifetimes that are "something like supertype" ofU
) - Outlived-bounded (my current preference, but it sounds weird) (because the
U: 'a
bound is actually read asU
outlives'a
, so the universal quantifier ranges over lifetimes outlived byU
)
... or is there anything better/already established? I do not remember reading anything on this topic ...