Skip to content

Conversation

aatifsyed
Copy link
Contributor

@aatifsyed aatifsyed commented Sep 18, 2025

My usecase is

pub struct Yak {
    id: YakId,
    pub name: String,
}
impl Yak {
    fn id(&self) -> YakId;
}
struct YakMgr(iddqd::IdHashMap<Yak>);
impl YakMgr {
    fn get_mut(&mut self, id: YakId) -> &mut Yak;
}

Users have no access to id

@aatifsyed
Copy link
Contributor Author

Hi @sunshowers, any enthusiasm for this PR? :)

@sunshowers
Copy link
Collaborator

Thanks. I'm generally open to this, but ideally I'd not put this on RefMut because (for IdOrdMap) that requires that the key type implements Hash. Instead I'm wondering if it makes sense to have get_mut_unchecked (and so on) on the map types directly. I'm not sure, that seems like it bloats up the API a bunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants