pub struct WebSocketSession { /* private fields */ }Expand description
Our websocket wrapper
Implementations§
Source§impl WebSocketSession
impl WebSocketSession
pub fn new( ctx: ConnectionContext, tx: UnboundedSender<WebSocketMessage>, ) -> Self
Sourcepub fn send(
&self,
message: WebSocketMessage,
) -> Result<(), SendError<WebSocketMessage>>
pub fn send( &self, message: WebSocketMessage, ) -> Result<(), SendError<WebSocketMessage>>
Send message to the web socket connection
Sourcepub fn channel(&self) -> UnboundedSender<WebSocketMessage>
pub fn channel(&self) -> UnboundedSender<WebSocketMessage>
Provides a Sender channel to send messages to the web socket connection
Sourcepub fn context(&self) -> &ConnectionContext
pub fn context(&self) -> &ConnectionContext
Returns the http request context for this web socket connection
Trait Implementations§
Source§impl Clone for WebSocketSession
impl Clone for WebSocketSession
Source§fn clone(&self) -> WebSocketSession
fn clone(&self) -> WebSocketSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WebSocketSession
impl RefUnwindSafe for WebSocketSession
impl Send for WebSocketSession
impl Sync for WebSocketSession
impl Unpin for WebSocketSession
impl UnsafeUnpin 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