pub struct DnodeProxy { /* private fields */ }Expand description
DNODE_PEER_PROXY listener.
Implementations§
Source§impl DnodeProxy
impl DnodeProxy
Sourcepub fn with_tls(self, acceptor: TlsAcceptor) -> Self
pub fn with_tls(self, acceptor: TlsAcceptor) -> Self
Attach a TLS acceptor; every accepted peer is wrapped via
TlsAcceptor::accept before being handed off to the
per-peer driver. When the acceptor is unset (the default)
the listener serves plaintext TCP, matching the historical
behaviour.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Local address of the listener.
Sourcepub async fn run<F>(
self,
cancel: Pin<Box<dyn Future<Output = ()> + Send>>,
handler_factory: F,
) -> Result<(), NetError>
pub async fn run<F>( self, cancel: Pin<Box<dyn Future<Output = ()> + Send>>, handler_factory: F, ) -> Result<(), NetError>
Drive the accept loop. The supplied handler_factory is
called once per accepted peer; it receives the
per-connection responder sender (the matching half of the
channel the inbound driver reads from) and returns the
ClientHandler the per-peer loop should use.
§Errors
Forwarded from the listener accept call.
Auto Trait Implementations§
impl !Freeze for DnodeProxy
impl !RefUnwindSafe for DnodeProxy
impl Send for DnodeProxy
impl Sync for DnodeProxy
impl Unpin for DnodeProxy
impl UnsafeUnpin for DnodeProxy
impl !UnwindSafe for DnodeProxy
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