use std::ops::{Deref, DerefMut}; use filamento::{roster::Contact, user::User}; use reactive_stores::Store; use crate::user::MacawUser; #[derive(Clone)] pub struct MacawContact { pub contact: Store, pub user: MacawUser, } impl MacawContact { pub fn got_contact_and_user(contact: Contact, user: User) -> Self { let contact = Store::new(contact); let user = MacawUser::got_user(user); Self { contact, user } } } impl Deref for MacawContact { type Target = Store; fn deref(&self) -> &Self::Target { &self.contact } } impl DerefMut for MacawContact { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.contact } }