autexousious
autexousious copied to clipboard
Use generic associated type in `StdinMapper`s
In GitLab by @azriel91 on Sep 26, 2018, 13:20
Generic associated types will allow you to specify associated types that contain lifetimes (similar thread):
pub trait StdinMapper {
type Resources: for<'res> SystemData<'res>;
}
// other crate:
pub struct CharacterSelectionEventStdinMapper {
type Resources<'res> = Read<'res, CharacterAssets>;
}
Currently GATs hasn't been stabilized, so we aren't able to parameterize the Resources associated type with the lifetime.
Pending rust-lang/rust #44265.