pub struct RoomManager { /* private fields */ }Expand description
Manages a collection of Rooms.
Implementations§
Source§impl RoomManager
impl RoomManager
Sourcepub fn get_or_create(&self, room_id: &str) -> Arc<Room> ⓘ
pub fn get_or_create(&self, room_id: &str) -> Arc<Room> ⓘ
Get an existing room or create a new one with default capacity (1024).
Sourcepub fn get_or_create_with_capacity(
&self,
room_id: &str,
capacity: usize,
) -> Arc<Room> ⓘ
pub fn get_or_create_with_capacity( &self, room_id: &str, capacity: usize, ) -> Arc<Room> ⓘ
Get an existing room or create with custom capacity.
Sourcepub fn remove(&self, room_id: &str) -> Option<Arc<Room>>
pub fn remove(&self, room_id: &str) -> Option<Arc<Room>>
Remove a room by id, returning it if present.
Sourcepub fn room_count(&self) -> usize
pub fn room_count(&self) -> usize
Number of rooms.
Trait Implementations§
Source§impl Debug for RoomManager
impl Debug for RoomManager
Source§impl Default for RoomManager
impl Default for RoomManager
Source§fn default() -> RoomManager
fn default() -> RoomManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RoomManager
impl !UnwindSafe for RoomManager
impl Freeze for RoomManager
impl Send for RoomManager
impl Sync for RoomManager
impl Unpin for RoomManager
impl UnsafeUnpin for RoomManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more