pub struct FlareServer { /* private fields */ }Expand description
Flare 服务端
Implementations§
Source§impl FlareServer
impl FlareServer
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
检查服务端是否运行
Sourcepub fn connection_count(&self) -> usize
pub fn connection_count(&self) -> usize
获取连接数量
Sourcepub fn user_count(&self) -> usize
pub fn user_count(&self) -> usize
获取用户数量
Sourcepub async fn broadcast_except(
&self,
frame: &Frame,
exclude_connection_id: &str,
) -> Result<()>
pub async fn broadcast_except( &self, frame: &Frame, exclude_connection_id: &str, ) -> Result<()>
广播消息到所有连接,排除指定连接
Sourcepub async fn disconnect(&self, connection_id: &str) -> Result<()>
pub async fn disconnect(&self, connection_id: &str) -> Result<()>
断开指定连接
Sourcepub fn protocols(&self) -> Vec<TransportProtocol>
pub fn protocols(&self) -> Vec<TransportProtocol>
获取协议列表
Sourcepub fn get_server_handle_components(
&self,
) -> Option<Arc<dyn ConnectionManagerTrait>>
pub fn get_server_handle_components( &self, ) -> Option<Arc<dyn ConnectionManagerTrait>>
Sourcepub fn get_server_handle(&self) -> Option<Arc<dyn ServerHandle>>
pub fn get_server_handle(&self) -> Option<Arc<dyn ServerHandle>>
获取 ServerHandle(用于消息发送和连接管理)
Auto Trait Implementations§
impl !RefUnwindSafe for FlareServer
impl !UnwindSafe for FlareServer
impl Freeze for FlareServer
impl Send for FlareServer
impl Sync for FlareServer
impl Unpin for FlareServer
impl UnsafeUnpin for FlareServer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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