I have a structure with some shared immutable data, and another structure that makes use of that data. I'd like to bundle these into one structure because they make logical sense together. However, I don't understand how I can provide a reference to the object itself during construction:
struct A {
v: i32,
}
struct B<'a> {
a: &'a A,
b: i32,
}
struct C<'a> {
a: A,
b: B<'a>,
}
fn main() {
C {
a: A { v: 13 },
b: B { a: &??, b: 17 },
}
}