pub struct WebSocketContext { /* private fields */ }
Expand description
WebSocket上下文,提供WebSocket相关配置和处理器
Implementations§
Source§impl WebSocketContext
impl WebSocketContext
Sourcepub fn properties(&self) -> &WebSocketProperties
pub fn properties(&self) -> &WebSocketProperties
Sourcepub fn add_handler(&mut self, path: &str, handler: Arc<dyn WebSocketHandler>)
pub fn add_handler(&mut self, path: &str, handler: Arc<dyn WebSocketHandler>)
添加WebSocket处理器
Sourcepub fn get_handler(&self, path: &str) -> Option<&Arc<dyn WebSocketHandler>>
pub fn get_handler(&self, path: &str) -> Option<&Arc<dyn WebSocketHandler>>
根据路径获取处理器
Trait Implementations§
Source§impl Clone for WebSocketContext
impl Clone for WebSocketContext
Source§fn clone(&self) -> WebSocketContext
fn clone(&self) -> WebSocketContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DefaultProvider for WebSocketContext
impl DefaultProvider for WebSocketContext
Auto Trait Implementations§
impl !Freeze for WebSocketContext
impl !RefUnwindSafe for WebSocketContext
impl Send for WebSocketContext
impl Sync for WebSocketContext
impl Unpin for WebSocketContext
impl !UnwindSafe for WebSocketContext
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