pub struct ConnectionManager { /* private fields */ }Implementations§
Source§impl ConnectionManager
impl ConnectionManager
pub fn new() -> Self
Sourcepub async fn set_writer(
&self,
writer: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>,
)
pub async fn set_writer( &self, writer: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>, )
Sets the WebSocket write sink (called after successful connection)
Sourcepub async fn state(&self) -> ConnectionState
pub async fn state(&self) -> ConnectionState
Gets the current connection state
Sourcepub async fn set_state(&self, new_state: ConnectionState)
pub async fn set_state(&self, new_state: ConnectionState)
Sets the connection state
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Checks if currently connected
Sourcepub async fn send_message(&self, msg: RealtimeMessage) -> Result<()>
pub async fn send_message(&self, msg: RealtimeMessage) -> Result<()>
Sends a message through the WebSocket connection
Sourcepub async fn clear_writer(&self)
pub async fn clear_writer(&self)
Clears the writer (used during disconnect)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionManager
impl !RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl !UnwindSafe for ConnectionManager
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