Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic associated type in StdinMappers #76

Open
azriel91 opened this issue Mar 12, 2020 · 0 comments
Open

Use generic associated type in StdinMappers #76

azriel91 opened this issue Mar 12, 2020 · 0 comments
Labels
M: code Code maintenance and quality. W: third party Waiting on a third party's action.
Milestone

Comments

@azriel91
Copy link
Owner

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 azriel91 added M: code Code maintenance and quality. W: third party Waiting on a third party's action. labels Mar 12, 2020
@azriel91 azriel91 added this to the Backlog milestone Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M: code Code maintenance and quality. W: third party Waiting on a third party's action.
Projects
None yet
Development

No branches or pull requests

1 participant