pub struct ConnectionStateManager { /* private fields */ }Expand description
Connection state manager for thread-safe state management
Provides atomic operations for connection state changes with proper ordering guarantees for concurrent access.
Implementations§
Source§impl ConnectionStateManager
impl ConnectionStateManager
Sourcepub fn get_state(&self) -> WebSocketConnectionState
pub fn get_state(&self) -> WebSocketConnectionState
Get the current connection state
Sourcepub fn set_state(&self, new_state: WebSocketConnectionState)
pub fn set_state(&self, new_state: WebSocketConnectionState)
Set the connection state
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if currently connected
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if authenticated
Sourcepub fn try_transition(
&self,
from: WebSocketConnectionState,
to: WebSocketConnectionState,
) -> bool
pub fn try_transition( &self, from: WebSocketConnectionState, to: WebSocketConnectionState, ) -> bool
Attempt to transition state (returns success)
Trait Implementations§
Source§impl Clone for ConnectionStateManager
impl Clone for ConnectionStateManager
Source§fn clone(&self) -> ConnectionStateManager
fn clone(&self) -> ConnectionStateManager
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectionStateManager
impl Debug for ConnectionStateManager
Auto Trait Implementations§
impl Freeze for ConnectionStateManager
impl RefUnwindSafe for ConnectionStateManager
impl Send for ConnectionStateManager
impl Sync for ConnectionStateManager
impl Unpin for ConnectionStateManager
impl UnwindSafe for ConnectionStateManager
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