pub struct WebSocketSession { /* private fields */ }Expand description
WebSocket session manager
Implementations§
Source§impl WebSocketSession
impl WebSocketSession
Sourcepub fn new(config: WebSocketConfig) -> Self
pub fn new(config: WebSocketConfig) -> Self
Create a new WebSocket session
Sourcepub async fn state(&self) -> ConnectionState
pub async fn state(&self) -> ConnectionState
Get the current connection state
Sourcepub async fn set_state(&self, new_state: ConnectionState)
pub async fn set_state(&self, new_state: ConnectionState)
Set the connection state
Sourcepub fn config(&self) -> &WebSocketConfig
pub fn config(&self) -> &WebSocketConfig
Get the configuration
Sourcepub fn subscription_manager(&self) -> Arc<Mutex<SubscriptionManager>>
pub fn subscription_manager(&self) -> Arc<Mutex<SubscriptionManager>>
Get the subscription manager
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if session is connected
Sourcepub async fn is_authenticated(&self) -> bool
pub async fn is_authenticated(&self) -> bool
Check if session is authenticated
Sourcepub async fn mark_authenticated(&self)
pub async fn mark_authenticated(&self)
Mark session as authenticated
Sourcepub async fn mark_disconnected(&self)
pub async fn mark_disconnected(&self)
Mark session as disconnected
Sourcepub async fn reactivate_subscriptions(&self)
pub async fn reactivate_subscriptions(&self)
Reactivate subscriptions after reconnection
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSocketSession
impl !RefUnwindSafe for WebSocketSession
impl Send for WebSocketSession
impl Sync for WebSocketSession
impl Unpin for WebSocketSession
impl !UnwindSafe for WebSocketSession
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