pub trait RoomOps: Send + Sync {
// Required methods
fn join(
&self,
room: &str,
user_id: &str,
data: Option<Value>,
) -> Result<(Value, Value), DataError>;
fn leave(&self, room: &str, user_id: &str) -> Option<Value>;
fn set_presence(
&self,
room: &str,
user_id: &str,
data: Value,
) -> Option<Value>;
fn broadcast(
&self,
room: &str,
sender: Option<&str>,
topic: &str,
data: Value,
) -> Option<Value>;
fn list_rooms(&self) -> Vec<String>;
fn room_size(&self, name: &str) -> usize;
fn members(&self, name: &str) -> Vec<Value>;
}Expand description
Room operations used by the router.