pub struct WebSocketServerConnection { /* private fields */ }Expand description
WebSocket connection wrapper for server connections
Implementations§
Source§impl WebSocketServerConnection
impl WebSocketServerConnection
Sourcepub fn new(
stream: WebSocketStream<TcpStream>,
remote_addr: SocketAddr,
config: WebSocketConfig,
) -> Self
pub fn new( stream: WebSocketStream<TcpStream>, remote_addr: SocketAddr, config: WebSocketConfig, ) -> Self
Create a new WebSocket server connection
Trait Implementations§
Source§impl Connection for WebSocketServerConnection
impl Connection for WebSocketServerConnection
Source§fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send data over the connection
Source§fn receive<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Bytes, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Bytes, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive data from the connection
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the connection gracefully
Source§fn metrics(&self) -> ConnectionMetrics
fn metrics(&self) -> ConnectionMetrics
Get connection metrics
Source§fn remote_addr(&self) -> SocketAddr
fn remote_addr(&self) -> SocketAddr
Get the remote address
Source§fn transport_type(&self) -> TransportType
fn transport_type(&self) -> TransportType
Get the transport type
Auto Trait Implementations§
impl Freeze for WebSocketServerConnection
impl !RefUnwindSafe for WebSocketServerConnection
impl Send for WebSocketServerConnection
impl Sync for WebSocketServerConnection
impl Unpin for WebSocketServerConnection
impl !UnwindSafe for WebSocketServerConnection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more