use super::*; impl Userspace { /// Is this `User` or `Group` ID present in this space? pub fn contains_id(&self, ent: &impl AsEntityId) -> bool { ent.entity_id().find_in_space(self).is_some() } /// Get a user reference from their ID pub fn user_ref(&self, id: UserID) -> Option> { if self.users.contains_key(&id) { Some(UserRef(id, &self)) } else { None } } /// Get a group reference from their ID pub fn group_ref(&self, id: GroupID) -> Option> { if self.groups.contains_key(&id) { Some(GroupRef(id, &self)) } else { None } } }