pub(super) struct WsAcceptor<W> {
pub(super) listener: Box<dyn StreamListener>,
pub(super) layer: Arc<WsLayer<W>>,
pub(super) tls: Option<TlsLayer>,
pub(super) handshake_timeout: Duration,
}Expand description
WebSocket acceptor, with an optional TLS handshake for wss://.
Fields§
§listener: Box<dyn StreamListener>§layer: Arc<WsLayer<W>>§tls: Option<TlsLayer>Set for wss:// endpoints; applied before the WS handshake.
handshake_timeout: DurationImplementations§
Source§impl<W> WsAcceptor<W>where
W: JsonRpcWsCodec,
impl<W> WsAcceptor<W>where
W: JsonRpcWsCodec,
Trait Implementations§
Source§impl<W> AsyncAcceptor for WsAcceptor<W>where
W: JsonRpcWsCodec,
impl<W> AsyncAcceptor for WsAcceptor<W>where
W: JsonRpcWsCodec,
Source§fn accept<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ByteStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ByteStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Kernel accept only, before any handshake.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
stream: Box<dyn ByteStream>,
server: &'life1 Arc<Server>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
stream: Box<dyn ByteStream>,
server: &'life1 Arc<Server>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Upgrade the stream, frame it, and hand it to the server.
fn local_endpoint(&self) -> Result<Endpoint>
Auto Trait Implementations§
impl<W> !RefUnwindSafe for WsAcceptor<W>
impl<W> !UnwindSafe for WsAcceptor<W>
impl<W> Freeze for WsAcceptor<W>
impl<W> Send for WsAcceptor<W>
impl<W> Sync for WsAcceptor<W>
impl<W> Unpin for WsAcceptor<W>
impl<W> UnsafeUnpin for WsAcceptor<W>
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