“The parameter type `C` may not live long enough”, when it doesn't need to
问题 I'm writing very basic AI system in Rust. It's main components are: Action s, which can be implemented by library user, for specific use, Generic Context , which is passed to all actions, and only needs to live during the action execution, ActionsContainer , which "globally" stores all possible actions, System , which chooses the correct action and runs it. There are many systems, one for each agent. However, they share the same set of behaviours, so they all reference a common