pub(super) struct StreamAcceptor<C> {
pub(super) listener: Box<dyn StreamListener>,
pub(super) codec: C,
pub(super) tls: Option<TlsLayer>,
pub(super) handshake_timeout: Duration,
}Expand description
Byte-stream acceptor, with an optional TLS handshake.
Fields§
§listener: Box<dyn StreamListener>§codec: C§tls: Option<TlsLayer>Set for tls:// endpoints; applied in handle.
handshake_timeout: DurationTrait Implementations§
Source§impl<C> AsyncAcceptor for StreamAcceptor<C>where
C: JsonRpcCodec,
impl<C> AsyncAcceptor for StreamAcceptor<C>where
C: JsonRpcCodec,
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<C> !RefUnwindSafe for StreamAcceptor<C>
impl<C> !UnwindSafe for StreamAcceptor<C>
impl<C> Freeze for StreamAcceptor<C>where
C: Freeze,
impl<C> Send for StreamAcceptor<C>where
C: Send,
impl<C> Sync for StreamAcceptor<C>where
C: Sync,
impl<C> Unpin for StreamAcceptor<C>where
C: Unpin,
impl<C> UnsafeUnpin for StreamAcceptor<C>where
C: UnsafeUnpin,
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