The variance of lifetime and type parameters of your own structs is automatically inferred from how you use those parameters in your field. For example if you have a

fn main() {
struct AllMine<'a, T>(&'a mut T);

Then AllMine is covariant in 'a and invariant in T, just like &'a mut T is.