pub struct SyncService { /* private fields */ }Implementations§
Source§impl SyncService
impl SyncService
pub fn new(yrs_manager: Arc<YrsManager>) -> Self
Sourcepub async fn is_room_initialized(&self, room_id: &str) -> bool
pub async fn is_room_initialized(&self, room_id: &str) -> bool
检查房间是否已初始化(有数据)
Sourcepub async fn get_room_status(&self, room_id: &str) -> RoomStatus
pub async fn get_room_status(&self, room_id: &str) -> RoomStatus
获取房间状态信息
Sourcepub async fn get_room_info(&self, room_id: &str) -> Option<RoomInfo>
pub async fn get_room_info(&self, room_id: &str) -> Option<RoomInfo>
获取房间详细信息
Sourcepub async fn offline_room(
&self,
room_id: &str,
save_data: bool,
) -> Result<Option<RoomSnapshot>>
pub async fn offline_room( &self, room_id: &str, save_data: bool, ) -> Result<Option<RoomSnapshot>>
房间下线 - 核心下线方法
- 断开所有客户端
- 可选保存数据
- 清理资源
Sourcepub async fn force_offline_room(&self, room_id: &str) -> Result<bool>
pub async fn force_offline_room(&self, room_id: &str) -> Result<bool>
强制房间下线(用于紧急情况)
Sourcepub async fn offline_rooms(
&self,
room_ids: &[String],
save_data: bool,
) -> Result<Vec<(String, Option<RoomSnapshot>)>>
pub async fn offline_rooms( &self, room_ids: &[String], save_data: bool, ) -> Result<Vec<(String, Option<RoomSnapshot>)>>
批量下线房间
Sourcepub fn get_active_rooms(&self) -> Vec<String>
pub fn get_active_rooms(&self) -> Vec<String>
获取所有活跃房间列表
Sourcepub async fn get_rooms_stats(&self) -> Vec<RoomInfo>
pub async fn get_rooms_stats(&self) -> Vec<RoomInfo>
获取房间统计信息
Sourcepub fn yrs_manager(&self) -> &Arc<YrsManager> ⓘ
pub fn yrs_manager(&self) -> &Arc<YrsManager> ⓘ
获取 YrsManager 的引用(用于高级操作)
Trait Implementations§
Source§impl Clone for SyncService
impl Clone for SyncService
Auto Trait Implementations§
impl !RefUnwindSafe for SyncService
impl !UnwindSafe for SyncService
impl Freeze for SyncService
impl Send for SyncService
impl Sync for SyncService
impl Unpin for SyncService
impl UnsafeUnpin for SyncService
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