use std::rc::Rc; use async_trait::async_trait; use super::{ common::Avatar, room::{Invitation, RoomId}, room_member::RoomMember, space::SpaceId, }; #[allow(dead_code)] pub trait AccountStoreConsumerInterface {} pub trait AccountStoreProviderInterface { fn on_new_room( &self, room: Rc, ) -> Rc; fn on_new_space( &self, space: Rc, ) -> Rc; } #[async_trait(?Send)] pub trait RoomStoreConsumerInterface { fn id(&self) -> &RoomId; fn is_direct(&self) -> Option; fn name(&self) -> Option; fn topic(&self) -> Option; #[allow(dead_code)] async fn avatar(&self) -> Option; fn spaces(&self) -> &Vec; } pub trait RoomStoreProviderInterface { fn on_new_name(&self, name: Option); fn on_new_avatar(&self, avatar: Option); fn on_new_topic(&self, topic: Option); fn on_new_member(&self, member: RoomMember); fn on_invitation(&self, invitation: Invitation); } #[allow(dead_code)] pub trait SpaceStoreConsumerInterface { fn id(&self) -> &SpaceId; fn name(&self) -> Option; } pub trait SpaceStoreProviderInterface { fn set_name(&self, _name: Option) {} }