autexousious icon indicating copy to clipboard operation
autexousious copied to clipboard

Use generic associated type in `StdinMapper`s

Open azriel91 opened this issue 6 years ago • 0 comments

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.

azriel91 avatar Mar 12 '20 10:03 azriel91