Hey there. I have a struct that looks like so:
struct TestEntity{
position: render_object::Position,
texture: sdl2::render::Texture,
game_context_ref: game_context::GameContext,
game_canvas_rev: sdl2::render::Canvas<sdl2::video::Window>,
}
The documentation for the Texture object is here:
I receive the error:
error[E0106]: missing lifetime specifier
--> src\entities\test_entity.rs:7:14
|
7 | texture: sdl2::render::Texture,
| ^^^^^^^^^^^^^^^^^^^^^ expected lifetime parameter
error: aborting due to previous error
I'm not quite sure why a lifetime specifier is required here, or what it's even looking for with respect to one. As I understand it, lifetime specifiers are required for references, but this is the declaration for the field of a struct. Why is it needed and how do I satisfy the compiler's requirement, here?