Lifetime problem when using functions

Hello,
I am trying to speed up my program by using reference instead of cloning structs.
But I understand that 'a must live along with launch function, but I don't know how to resolve the problem without sacrifying speed.
I need &mut : it works perfectly with immutable...

Thank you in advance for your help.

&'a mut self when 'a appears in the type you're implement is never a good idea and will always fail to compile. From your struct definition it seems you're trying to have a field reference another field: this is called a self-referential struct and is not possible in safe rust. Consider using indexes instead, or split your struct in two.

2 Likes